pai CLI & Terminal
cli-parser
Command-line argument parser. Define flags with long/short names, defaults and types, then parse ParamStr arguments automatically.
Install ppm install cli-parser
Usage Example
uses cli_parser; var p := Create('myapp', '1.0.0'); AddFlag(p, 'output', 'o', 'Output file', 'result.txt', False); AddFlag(p, 'workers', 'w', 'Worker count', '4', False); AddBool(p, 'verbose', 'v', 'Enable verbose'); AddBool(p, 'dry-run', 'd', 'Simulate only'); Parse(p, CommandLineArgs); var outFile := Get(p, 'output'); var verbose := GetBool(p, 'verbose'); if verbose then WriteLn('Output: ' + outFile); PrintHelp(p);
Features
Long (--flag) and short (-f) flag names
Default values for optional flags
Boolean flags (no value)
Required flag validation
Auto-generated --help output
← Back to Package Index