These are chat archives for kbknapp/clap-rs
-V, --versionis disabled for subcommands that haven't defined a version, or at least inherit the version of the parent command?
App::global_version(true)which may be what direction I end up taking. At the same time, it's probably one of those issues which isn't a huge issue in practice. For instance, I don't know many people that do a
program subcommand --versionexpecting the program version (or they'd just do
global(true), but then you have to manually check
matches.is_present("version")and handle it accordingly.
version(&*crate_version!())on each subcommand to automatically get the crate version (may only be an option if you only have a few subcommands)
--versionoptions removed for subcommands that don't have their own version defined is imo the best option.
-Vis totally possible, and simply removes it from
App::global_version(bool)in order to allow both methodologies
clap, but they're getting quite old and I've been in the process of updating them forever. All the content still works, but it's missing a ton of the newer features. And that's also geared more towards
clapspecific and not really learning Rust
clapsource is kind of a mess, but at least grouped somewhat decently. So if you find a feature you want to hack on, go for it! And if you get it working, put in a PR. Actually even if you almost get it working put in a PR and I can try and help sort it out or guide it
I made a Gist with a bunch of ideas I have: https://gist.github.com/SShrike/9256bcf7807d4d0b1f7a
It's incomplete since I still have a few ideas to type out. Also, sorry for the sloppy writing. (I'd pulled an all-nighter the night before, so naturally since it is 7:53 PM over here I'm starting to feel pretty tired)