Skip to content
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

Help command and flag have a name conflict #27

Open
cdlm opened this issue Aug 28, 2018 · 4 comments
Open

Help command and flag have a name conflict #27

cdlm opened this issue Aug 28, 2018 · 4 comments

Comments

@cdlm
Copy link
Collaborator

cdlm commented Aug 28, 2018

This requires some boilerplate in the root command (or any that wants to support both foo help and foo --help)

@capsulecorplab
Copy link
Contributor

If the issue is concerning what the default behavior should be, https://clig.dev/#help suggests displaying help text when passed no options, the -h flag, or the --help flag.

@cdlm
Copy link
Collaborator Author

cdlm commented Mar 10, 2021

Not really: commands and flags are looked up by their base name which doesn't allow to differentiate between commands and flags. So in practice you get the first one found in the internal data structure, which is not great.

A fix should not be too hard to implement, it's mostly a matter of UX and keeping the code clean. This might already been fixed actually, I haven't had a look at the code in a while and don't remember where I left things.

@capsulecorplab
Copy link
Contributor

Is this something that could be potentially resolved with a unit test package (spec'd in a baseline)?

@cdlm
Copy link
Collaborator Author

cdlm commented Mar 10, 2021

This issue is probably fixed, given this test exists (rejecting duplicate identifiers).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants