cli-matic icon indicating copy to clipboard operation
cli-matic copied to clipboard

Adding `app --version`

Open l3nz opened this issue 5 years ago • 6 comments

It's common for terminal apps to be called like app --version to print the version. Is this possible?

Originally posted by @thiru in https://github.com/l3nz/cli-matic/issues/35#issuecomment-480977084

l3nz avatar Apr 10 '19 18:04 l3nz

@thiru Added as separate bug.

l3nz avatar Apr 10 '19 18:04 l3nz

This should only be added as "--version" (with no shortcut) to global options.

So app --version will work and print :app :version, while app cmd --version has no meaning.

l3nz avatar Apr 10 '19 18:04 l3nz

Yes that would be perfect, thank you!

thiru avatar Apr 10 '19 18:04 thiru

BTW, as per #69 , we could have recursive :version keys, so a subcomand could have different (sub) version.

l3nz avatar Nov 03 '19 19:11 l3nz

Sweet thanks!

Versions on sub-commands seem niche. I personally haven't found a need for them but still nice to have the option.

thiru avatar Nov 05 '19 01:11 thiru

Hello @l3nz ,

Could you please share a working example on how exactly, this could be achieved with cli-matic "0.4.3"] ?

I have been trying to get the same use case working app --version without success 😞 .

abhi18av avatar Oct 22 '21 21:10 abhi18av