Skip to content
Discussion options

You must be logged in to vote

Is this the right way of implementing a version subcommand (using the Derive API)?

I'd print to stdout, instead of stderr, like --help.

Depending on the structure of your program, you want to make sure that you don't accidentally fallback into other behavior.

Would it make sense to implement this subcommand into Clap itself by default?

I'm surprised I'm not seeing a previous discussion on this but maybe I haven't found it yet.

It would be a breaking change and would have to wait until v5 (which also means it could just be put under unstable-v5 feature flag). We'd need to weigh out the expectations (how regularly are these expected to be there?), costs (increased API size, binary bloat…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by fanninpm
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants