Closed ckotte closed 4 years ago
Haha nicely spotted 🙂 To be honest I found this weird too, but that's how Go devs decided to implement this (I'm just using the standard library flag
for this) 🤷♂️.
The good news are that like you noticed, both one and two dashes are recognized correctly.
Having two options (long and short) is also not supported by the standard library.
While it is possible to find some third-party library to implement these flags, it feels like an overkill 🙂
What do you think?
Is the help output generated automatically by flag
? If so, then it would be overkill to implement a third-party library.
I'm just used to the different other command-line tools which use short and long options. I don't have any experience with go, but looks like they don't care about short and long options. I thought it was more or less a standard. ;)
Yep, the help is generated by flag
too. Personally I agree with you, but if I remember correctly their argument was that not all tools follow this scheme, for example ip
uses single dashes and dd
uses no dashes at all.
In any case, it's not our battle to fight 😄
I don't want to be picky, but shouldn't the output include double dashes for the long options? Maybe also add
--verbose
as the long option alternative for-v
.However, it looks like every option works with one or two dashes.