mirror of
https://github.com/clap-rs/clap
synced 2024-12-13 22:32:33 +00:00
fix(Completions): fixes bug where --help and --version short weren't added to the completion list
Closes #563
This commit is contained in:
parent
0b4ee665ad
commit
cecfe981ea
1 changed files with 6 additions and 0 deletions
|
@ -1030,6 +1030,9 @@ impl<'a, 'b> Parser<'a, 'b>
|
||||||
help: Some("Prints help information"),
|
help: Some("Prints help information"),
|
||||||
..Default::default()
|
..Default::default()
|
||||||
};
|
};
|
||||||
|
if let Some(h) = self.help_short {
|
||||||
|
self.short_list.push(h);
|
||||||
|
}
|
||||||
self.long_list.push("help");
|
self.long_list.push("help");
|
||||||
self.flags.push(arg);
|
self.flags.push(arg);
|
||||||
}
|
}
|
||||||
|
@ -1047,6 +1050,9 @@ impl<'a, 'b> Parser<'a, 'b>
|
||||||
help: Some("Prints version information"),
|
help: Some("Prints version information"),
|
||||||
..Default::default()
|
..Default::default()
|
||||||
};
|
};
|
||||||
|
if let Some(v) = self.version_short {
|
||||||
|
self.short_list.push(v);
|
||||||
|
}
|
||||||
self.long_list.push("version");
|
self.long_list.push("version");
|
||||||
self.flags.push(arg);
|
self.flags.push(arg);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue