Parsing Pipeline
Input goes through three sequential stages before a Command object is produced:
| Stage | Input | Output | Role |
|---|---|---|---|
Scanner | string | string[] | Splits raw input into tokens |
Tokenizer | string[] | Token[] | Classifies each token as one of: command, terse flag, verbose flag, compound terse, argument, or explicit-assign |
Parser | Token[] | Command | Assembles tokens into a Command object with associated Option objects |
CommandBuilder is the static entry point that chains all three stages:
// From a string array (typical Main(string[] args) entry point)
Command cmd = CommandBuilder.Build(args);
// From a single string (the scanner splits it first)
Command cmd = CommandBuilder.Build("myapp.copy --from c:\\tmp\\a.txt --to c:\\tmp\\b.txt");The resulting Command is passed to DefinitionRegistry.GetCommandExecutor, which resolves the matching CommandDefinition and returns a CommandExecutor. Calling Execute() (or ExecuteAsync()) then runs the constraint and handler pipeline.