Fix short-flag completion (#6067)

This commit is contained in:
Jack Clayton
2022-07-17 20:46:40 +08:00
committed by GitHub
parent 9d0be7d96f
commit 9ced5915ff
6 changed files with 76 additions and 14 deletions

View File

@ -791,7 +791,18 @@ pub fn parse_internal_call(
&signature,
);
if let Some(short_flags) = short_flags {
if let Some(mut short_flags) = short_flags {
if short_flags.is_empty() {
short_flags.push(Flag {
long: "".to_string(),
short: Some('a'),
arg: None,
required: false,
desc: "".to_string(),
var_id: None,
default_value: None,
})
}
error = error.or(err);
for flag in short_flags {
if let Some(arg_shape) = flag.arg {