comonicon / Comonicon.jl

Your best CLI generator in JuliaLang
https://comonicon.org
MIT License
284 stars 25 forks source link

Capital `-V` for version is a bit odd #215

Closed tecosaur closed 2 years ago

tecosaur commented 2 years ago

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 commented 2 years ago

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 commented 2 years ago

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 commented 2 years ago

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 commented 2 years ago

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