App::get_version? #1912
-
I'm trying to print name and version of my application on every run. I've found App::get_name(), but nothing to get the version. How do I get the version? Note: I use app_from_crate!() for instantiating App, but I do not want to use a separate call to crate_version!() to avoid duplicating the version code and creating inconsistencies by only one being changed later. |
Beta Was this translation helpful? Give feedback.
Answered by
CreepySkeleton
May 6, 2020
Replies: 1 comment 8 replies
-
In clap 2.33 If you want to see it in 3.0, feel free to submit a PR adding |
Beta Was this translation helpful? Give feedback.
8 replies
Answer selected by
shze
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
In clap 2.33
Arg.verison
field is#[hidden] pub
, you can use it directly. Hacky, but I don't think it will ever change.If you want to see it in 3.0, feel free to submit a PR adding
Arg::get_version
getter.