Documentation
¶
Overview ¶
Package shlex splits and quotes command lines the way the Rust shlex crate (1.3) does, byte for byte: the launcher's hooks, templates, and `-format q` output have to agree with what the Rust shell produced.
Splitting is POSIX-shell word splitting without expansion: single and double quotes, backslash escapes, and `#` comments at a word start. An unbalanced quote or a trailing backslash is an error, never half a command.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrNul = errors.New("cannot shell-quote string containing nul byte")
ErrNul reports a string that cannot be quoted because it holds a NUL byte (shlex::QuoteError::Nul).
Functions ¶
func MustQuote ¶
MustQuote is Quote with the input returned unchanged when it cannot be quoted - the `.unwrap_or_else(|_| text.clone())` the Rust callers use.
Types ¶
This section is empty.