shlex
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
type syntaxerr = !void;
Invalid shell syntax.
Functions
fn quote
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
fn quotestr(s: str) str;
Quotes a shell string and returns a new string. The caller must free the return value.
fn split
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
fn strerror(err: syntaxerr) str;
Converts an error into a human-friendly string.