-
Notifications
You must be signed in to change notification settings - Fork 83
Handle --version automatically #180
Comments
It is handled automatically: http://burntsushi.net/rustdoc/docopt/struct.Docopt.html#method.version |
Not really helpful since it still requires the version string to be given. I would suggest a default value like this: |
@kindlychung: With your suggestion you would end up using the ones set for docopt. Having "docopt, version: 0.6.86" or whatever as a default version string for your program doesn't really make sense. You could use a macro to work around that (the compilation of the expanded code would then happen in your crate so you would be fine). I don't know what would be a good API for that though. |
Having trouble with '--version' myself, but it could be that I'm still new to Rust. I figured the Rust version of 'docopt' would just display whatever version is in the Cargo.toml. That didn't happen, so I tried to set it like the Python version with:
That did not work either. Am I doing something wrong or is this part still a work in progress? - Thanks |
@ergose I'm not following. Why are you writing Python syntax in Rust? That certainly will not work. Please see the docs for the |
Would be nice not to have to fetch version string for every commandline tool.
The text was updated successfully, but these errors were encountered: