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

Capital -V for version is a bit odd #215

Closed
tecosaur opened this issue Aug 12, 2022 · 4 comments
Closed

Capital -V for version is a bit odd #215

tecosaur opened this issue Aug 12, 2022 · 4 comments

Comments

@tecosaur
Copy link
Contributor

It's nice that Comonicon automatically adds support for --version, but the "short flag" is not what I expected. I think -V is slightly non-standard, or at least much rarer than -v for --version, e.g.

~$ firefox -v
Mozilla Firefox 102.0.1
~$ plasmashell -v
plasmashell 5.25.2
~$ julia -v
julia version 1.7.3
~$ zotero -v
Zotero Zotero 6.0.4

Some commands do seem to grab -v (e.g. bash, cat, and others), however they tend to only offer --version and not use -V as a substitute.

With this all in mind, I think it might be more intuitive if Comonicon always offered --version, and then adds -v (not -V) automatically when it hasn't already been assigned to something else. Does this sound possible?

@Roger-luo
Copy link
Collaborator

I did a bit search and it seems the short option for --version is not required in either GNU CLI standard or https://clig.dev/. And in the CLI Guide, it mentions that sometimes this will conflict with --verbose thus people will use -d for verbose and -v for version. Given the fact that --version is probably not something frequently used by a user, maybe we can just not support the short option in general?

Also the current behavior is one cannot define their own version option, since this one is hard coded to have highest priority among all commands (similar to -h,--help), so the actual parsing logical is a bit different from others.

@singularitti
Copy link

pip also has -V for version and -v for verbose, which also makes me feel uncomfortable:

  -v, --verbose               Give more output. Option is additive, and can be used up to 3 times.
  -V, --version               Show version and exit.

I support we just deprecate the short -v flag.

@Roger-luo
Copy link
Collaborator

Ok I think I'll just remove the support of short option version but this is gonna be a breaking change so I'll postpone this change a bit.

@Roger-luo
Copy link
Collaborator

now -V is removed, only --version is generated

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

3 participants