Open JoshMcCullough opened 2 years ago
I am looking for command support too...
Hey @JoshMcCullough and @yfwz100 . Can you provide the use cases you are looking for with more detail? If you want to use command
, why not use yargs
directly?
The purpose of the library is to provide support for interactivity commands, using a yargs fashion, but also add the ability to pass values to these commands when the interactivity is not needed (i.e. in CI environments).
The use case is myapp do-it
with an arg, e.g. name
. When name
is not provided as an argument on the command line, then we'd like yargs-interactive to prompt for it. Currently you can only do interactive stuff without commands.
I came here looking for the same and thought it was somehow supported since the examples use .usage('$0 <command> [args]')
which would hint at "command" support. If that's not the case and not planned maybe these description should be updated to say just .usage('$0 [args]')
? Still agree with previous posters that the use case would be to have a main script with several commands where each command would support an interactive mode.
I don't see how to use this package with commands. E.g. ...
I can only call
.interactive(...)
and pass in options directly from theyargsInteractive()
return. I can't seem to configure an interactive command.