You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It's very common (almost mandatory) for CLI tools to provide a --version option which, when used, will just print the tool's version and exit. I couldn't find anything in argh's docs about how to best/most idiomatically implement this in (modern) argh.
Describe the solution you'd like
Somewhere in the docs there should be a short paragraph/example on how to implement best implement --version.
This might be a good candidate for the cookbook section of the docs if it's not a built-in feature (see last secion of this issue) and requires a bit of boilerplate.
Describe alternatives you've considered
Don't document it and let people come up with their own solutions.
Only document it once additional features that make it easier to implement have been added to argh (which ones?).
Additional context
argparse makes implementing this as easy1 as adding an argument with action="version". AFAIU, argh uses argparse under the hood and exposes it where possible, so maybe this can be leveraged?
1 Compare this to how it's how it's done in Typer... Although to be fair, Typer seeks to provide a generic mechanism instead of special-casing it like argparse does.
The text was updated successfully, but these errors were encountered:
Is your feature request related to a problem?
It's very common (almost mandatory) for CLI tools to provide a
--version
option which, when used, will just print the tool's version and exit. I couldn't find anything in argh's docs about how to best/most idiomatically implement this in (modern) argh.Describe the solution you'd like
Somewhere in the docs there should be a short paragraph/example on how to implement best implement
--version
.This might be a good candidate for the cookbook section of the docs if it's not a built-in feature (see last secion of this issue) and requires a bit of boilerplate.
Describe alternatives you've considered
Additional context
argparse
makes implementing this as easy1 as adding an argument withaction="version"
. AFAIU, argh usesargparse
under the hood and exposes it where possible, so maybe this can be leveraged?1 Compare this to how it's how it's done in Typer... Although to be fair, Typer seeks to provide a generic mechanism instead of special-casing it like argparse does.
The text was updated successfully, but these errors were encountered: