-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Having a lot of difficulty getting nested commands #511
Comments
@ProLoser Have you ever figured out why the problem occurs? I too am at the same point. |
I think I went with a simpler library and did more heavy lifting myself but I don't remember the project. |
Based on my understanding of this library, if you pass a description to the I agree it would be nice if the documentation better explained the difference between the two types of commands and the implications of choosing one versus the other. I don't think "Git-style sub-commands" is the most appropriate heading. |
Good comment that "Git-style sub-commands" is not the most appropriate header. There are multiple other issues open about confusion over description changing behaviour, and I have this issue noted to link later. This issue has not had any activity in over six months. It isn't likely to get acted on due to this report. Feel free to open a new issue if it comes up again, with new information and renewed interest. Thank you for your contributions. |
So my coworker and I have been trying to use this library and we keep on running into problems.
I want to have 2 sub-commands. I want 1 command to execute by default if no command is specified. Both commands take Variadic arguments. I'd like to have top-level options that are used by sub commands, as well as sub-command specific options.
The results are constantly confusing (I don't get why not having a 'description' argument vs calling
.description()
has such a significant impact on behavior for example). It wasn't explicitly stated anywhere in your docs that calling.action()
or.command()
in any particular order was significant, or if calling.option()
in between those calls are significant, or if options cascade (although in several examples they appear to), or if / when I'm supposed to put an[options]
into my command or usage? Do I even need.usage()
?Doing things like
node index.js --help
vsnode index.js action --help
will almost never BOTH work (I seem to be able to get one or the other to work).I've seen errors where a top-level option is missing, and then when I specify it, I get an error saying that the very same option doesn't exist.
It's mind numbing. My experience using this library has been tweak the options a little and try running the script and seeing how commander vomits, rinse and repeat until you figure out the general gist of what you're supposed to do.
The text was updated successfully, but these errors were encountered: