Skip to main content

Module shell_parse

Module shell_parse 

Source
Expand description

Quote-aware shell command tokenizer.

Splits a command string into tokens respecting single quotes, double quotes, and backslash escapes. This prevents false-positive security rejections when metacharacters appear inside quoted arguments (e.g., echo 'hello;world').

Structs§

AnnotatedChar
A character annotated with its quoting context.
ShellToken
A parsed shell token.

Enums§

QuoteContext
Quoting context for a character in a shell token.

Functions§

tokenize
Tokenize a shell command string into tokens, respecting quoting rules.
tokenize_annotated
Tokenize and return annotated characters per token for policy evaluation.