alwaysai / alwayscli

A framework for building command-line interfaces in Node.js
Other
6 stars 2 forks source link

feat: "Escaped" arguments #14

Closed carnesen closed 5 years ago

carnesen commented 5 years ago

Currently the alwaysCLI framework does not provide a mechanism for supplying command-line options/args values that start with "--" because these are always interpreted as the start of an "option" group. In some cases though, we want to provide an input value that starts with "--". For example, we might want to do alwaysai app start --foo --bar where the "start" leaf launches a python process and we want to provide --foo and --bar as arguments to the python process.

This feature suggestion is to expand the command-line argument parser to incorporate a third category of input beyond args and options: say escaped. So, for example, "args" would be an input that receives all strings up to the first one of the form --something, "options" would handle all the strings after the args but before the first appearance of "--", and "escaped" would receive all strings after the first "--". Then the user could do alwaysai app start -- --foo --bar. And the "escaped" input to the leaf's "action" would receive ['--foo', '--bar'].

carnesen commented 5 years ago

Closed by #17