-
I have this working code using version 3 and wanted to give a try to version 4, the first thing I notice is that if I remove the version by using
With version 4 I don't get the name, just the Usage text directly
I also found that there are no more colors, Now I get text underlined, and when trying to use
And: let matches = Command::new("gbump")
.version(env!("CARGO_PKG_VERSION"))
.color(ColorChoice::Always) Still get the underline text and no colors. But I am getting lost trying to adapt this: Arg::with_name("version")
.takes_value(false)
.default_value("patch")
.possible_value("major")
.possible_value("minor")
.possible_value("patch"),
...
let mut semver = String::new();
if !matches.is_present("quiet") {
semver.push_str(format!("{}.{}.{} --> ", major, minor, patch).as_str());
}; I am trying: Arg::new("version")
.default_value("patch")
.value_parser(["major", "minor", "patch"]),
...
let mut semver = String::new();
if !matches.get_flag("quiet") {
semver.push_str(format!("{}.{}.{} --> ", major, minor, patch).as_str());
}; If I run it I get:
Any ideas? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 3 replies
-
As a heads up, most of this will be covered by the CHANGELOG.md and the release announcement
These are removed from the default help template as they didn't provide enough value to justify the vertical space being taken up. #4132 includes or links out to the related discussions on this and workarounds on how to get the old behavior (hint
#4132 is again the place to check out more information on this. #3234 will allow theming and is one of m,y focus areas right now. Until then, you can either use the styling available, not upgrade yet, or disable styling. As for
The CHANGELOG includes a migration guide. I highly recommend following it. Changes like this can and should be made before upgrading as it allows you to incrementally upgrade and verify your application.
I'm assuming that panic is pointing to |
Beta Was this translation helpful? Give feedback.
-
FYI clap's default terminal styling (colors) is being revisited in #5881. |
Beta Was this translation helpful? Give feedback.
As a heads up, most of this will be covered by the CHANGELOG.md and the release announcement
These are removed from the default help template as they didn't provide enough value to justify the vertical space being taken up. #4132 includes or links out to the related discussions on this and workarounds on how to get the old behavior (hint
Command::help_template
and the docs for it include the old template)#4132 is again the place to check out more infor…