Options in variadic argumentsSee original GitHub issue
In my particular use case I’d need to accept a variable number of cli arguments (including options) unrelated to cliffy after a series of valid args, for example:
mycmd --myoption mysubcmd myarg other args and --options | cliffy args <-|-> other args
To do this I’ve been using a variadic argument in
new Command() .command('mysubcmd [myarg] [otherArgs...]');
but I didn’t take into account that
--options could break it
[ERROR:...] Unknown option --options
Do you have any suggestions on how to accomplish this?
- Created 3 years ago
- Comments:6 (4 by maintainers)
Top GitHub Comments
in v0.9.0 is now a new way to resolve your issue. You can use .stopEarly() instead of
stopEarly is enabled, all arguments, starting from the first non option argument, will be interpreted as raw argument.
In contrast to
--version option will still work.