Use sade for sub-commands and inquirer for prompting. #32
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This should retain pretty much 100% compatibility. I'll do a final check before merging.
Why remove
meow
?Why not
commander
(i.e. "it's popular")?I'm compiling this from recent experience and memory:
undefined
as part of theaction()
arguments and you'd have to somehow refer to the global parsed options, but there wasn't any validation on them.cmd
being equivalent tocmd default
). Maybe it does do this, but its docs weren't clear to me. Having this not only retains backward compatibility, it also enables simpler use-cases where you only need one command.Why
sade
?meow
, it's very simple to write an option-based API over it without creating a maintenance burden.commander
also makes this pretty simple,sade
just supports stuff we want out of the box.Why
inquirer
?What does it look like?
See the README for
bin
but gist:options
like before, but now allows anoption.question
config that it passes toinquirer
.commands
option for defining sub-commands which can contain adescription
and anoptions
object for command-specific options andquestions
.default
sub-command is specified allowing it to be invoked without specifying a command (existing and simple behaviour).question
, you will be prompted to fill it in byinquirer
.