Schniz / cmd-ts

💻 A type-driven command line argument parser
https://cmd-ts.now.sh
MIT License
241 stars 25 forks source link

Support rest parameters #133

Closed Schniz closed 2 years ago

Schniz commented 2 years ago

allow the ability to catch all the arguments, not just positional. This will allow having a CLI that works like so:

fnm exec --using=12 node -v
                       ^^ - positional argument, can be forwarded

instead of:

fnm exec --using=12 -- node -v

The problem is that with the current implementation of the parser, options and circuitbreakers look "everywhere" within the node array so the following:

fnm exec --using=12 node --help

will be the same as:

fnm exec --help --using=12 node

Eventually this needs to be taken care of. A flag can be global, but the default behavior should be local to the declaration. CLI commands form a tree and we need to make sure we don't have global searches by default.

vercel[bot] commented 2 years ago

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/schniz/clio-ts/BYxrD2qYDc9yCHbboEvVrX1ozr7p
✅ Preview: https://clio-ts-git-support-rest-parameters-schniz.vercel.app