mirror of
https://github.com/clap-rs/clap
synced 2025-01-05 17:28:42 +00:00
parent
9006f9a716
commit
ac9f4727e0
1 changed files with 4 additions and 5 deletions
|
@ -4142,14 +4142,13 @@ impl<'help> Command<'help> {
|
||||||
.iter()
|
.iter()
|
||||||
.any(|sc| sc.long_flag == Some("help"))
|
.any(|sc| sc.long_flag == Some("help"))
|
||||||
{
|
{
|
||||||
debug!("Command::_check_help_and_version: Removing generated help");
|
|
||||||
|
|
||||||
let generated_help_pos = self
|
let generated_help_pos = self
|
||||||
.args
|
.args
|
||||||
.args()
|
.args()
|
||||||
.position(|x| x.id == Id::help_hash() && x.provider == ArgProvider::Generated);
|
.position(|x| x.id == Id::help_hash() && x.provider == ArgProvider::Generated);
|
||||||
|
|
||||||
if let Some(index) = generated_help_pos {
|
if let Some(index) = generated_help_pos {
|
||||||
|
debug!("Command::_check_help_and_version: Removing generated help");
|
||||||
self.args.remove(index);
|
self.args.remove(index);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
@ -4206,8 +4205,6 @@ To change `help`s short, call `cmd.arg(Arg::new(\"help\")...)`.",
|
||||||
.iter()
|
.iter()
|
||||||
.any(|sc| sc.long_flag == Some("version"))
|
.any(|sc| sc.long_flag == Some("version"))
|
||||||
{
|
{
|
||||||
debug!("Command::_check_help_and_version: Removing generated version");
|
|
||||||
|
|
||||||
// This is the check mentioned above that only checks for Generated, not
|
// This is the check mentioned above that only checks for Generated, not
|
||||||
// GeneratedMutated args by design.
|
// GeneratedMutated args by design.
|
||||||
let generated_version_pos = self
|
let generated_version_pos = self
|
||||||
|
@ -4216,6 +4213,7 @@ To change `help`s short, call `cmd.arg(Arg::new(\"help\")...)`.",
|
||||||
.position(|x| x.id == Id::version_hash() && x.provider == ArgProvider::Generated);
|
.position(|x| x.id == Id::version_hash() && x.provider == ArgProvider::Generated);
|
||||||
|
|
||||||
if let Some(index) = generated_version_pos {
|
if let Some(index) = generated_version_pos {
|
||||||
|
debug!("Command::_check_help_and_version: Removing generated version");
|
||||||
self.args.remove(index);
|
self.args.remove(index);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -4525,7 +4523,8 @@ impl<'help> Command<'help> {
|
||||||
stream: Stream,
|
stream: Stream,
|
||||||
) -> ClapResult<Colorizer> {
|
) -> ClapResult<Colorizer> {
|
||||||
debug!(
|
debug!(
|
||||||
"Parser::write_help_err: use_long={:?}, stream={:?}",
|
"Command::write_help_err: {}, use_long={:?}, stream={:?}",
|
||||||
|
self.get_display_name().unwrap_or_else(|| self.get_name()),
|
||||||
use_long && self.use_long_help(),
|
use_long && self.use_long_help(),
|
||||||
stream
|
stream
|
||||||
);
|
);
|
||||||
|
|
Loading…
Reference in a new issue