Expand description
Enhanced shell command parser that handles &&, ||, ;, and () operators This allows virtual commands to work properly with shell operators
Structs§
- Parsed
Arg - Parsed argument with quote information
- Redirect
- Redirect information
- Shell
Parser - Shell command parser
- Token
- A token with its type and original value
Enums§
- Parsed
Command - Types of parsed commands
- Token
Type - Token types for the parser
Functions§
- needs_
real_ shell - Check if a command needs shell features we don’t handle.
- parse_
shell_ command - Parse a shell command with support for &&, ||, ;, and ()
- remove_
shell_ quotes - Perform POSIX quote removal on a single already-tokenized word.
- split_
command_ words - Split a simple command string into its words, respecting quotes and applying
POSIX quote removal to each word. Operators are ignored, so this is meant for
simple commands (the virtual-command dispatch path). Mirrors the JS parser’s
per-argument quote removal so
echo label:'help wanted'yields["echo", "label:help wanted"]rather than splitting inside the quotes. - tokenize
- Tokenize a shell command string