shlex+x86_64 +linux

The shlex module provides lexical tools for working with POSIX shell grammar.

Index

Errors

type syntaxerr = !void;

Functions

fn quote(sink: io::handle, s: str) (size | io::error);
fn quotestr(s: str) str;
fn split(in: const str) ([]str | syntaxerr);
fn strerror(err: syntaxerr) str;

Errors

type syntaxerr[link]

type syntaxerr = !void;

Invalid shell syntax.

Functions

fn quote[link]

fn quote(sink: io::handle, s: str) (size | io::error);

Quotes a shell string and writes it to the provided I/O handle.

fn quotestr[link]

fn quotestr(s: str) str;

Quotes a shell string and returns a new string. The caller must free the return value.

fn split[link]

fn split(in: const str) ([]str | syntaxerr);

Splits a string of arguments according to shell quoting. The result must be freed using strings::freeall when the caller is done processing it.

fn strerror[link]

fn strerror(err: syntaxerr) str;

Converts an error into a human-friendly string.