Capital `-V` for version is a bit odd
tecosaur opened this issue · comments
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?
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.
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.
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.
now -V
is removed, only --version
is generated