Touchups to help

This commit is contained in:
JT 2021-10-14 06:58:39 +13:00
parent fdd2c35fd9
commit dcda7a4e50

View File

@ -260,11 +260,28 @@ fn get_flags_section(signature: &Signature) -> String {
if let Some(short) = flag.short { if let Some(short) = flag.short {
if flag.required { if flag.required {
format!( format!(
" -{}, --{} (required parameter){:?} {}\n", " -{}{} (required parameter){:?} {}\n",
short, flag.long, arg, flag.desc short,
if !flag.long.is_empty() {
format!(", --{}", flag.long)
} else {
"".into()
},
arg,
flag.desc
) )
} else { } else {
format!(" -{}, --{} {:?} {}\n", short, flag.long, arg, flag.desc) format!(
" -{}{} {:?} {}\n",
short,
if !flag.long.is_empty() {
format!(", --{}", flag.long)
} else {
"".into()
},
arg,
flag.desc
)
} }
} else if flag.required { } else if flag.required {
format!( format!(
@ -277,11 +294,26 @@ fn get_flags_section(signature: &Signature) -> String {
} else if let Some(short) = flag.short { } else if let Some(short) = flag.short {
if flag.required { if flag.required {
format!( format!(
" -{}, --{} (required parameter) {}\n", " -{}{} (required parameter) {}\n",
short, flag.long, flag.desc short,
if !flag.long.is_empty() {
format!(", --{}", flag.long)
} else {
"".into()
},
flag.desc
) )
} else { } else {
format!(" -{}, --{} {}\n", short, flag.long, flag.desc) format!(
" -{}{} {}\n",
short,
if !flag.long.is_empty() {
format!(", --{}", flag.long)
} else {
"".into()
},
flag.desc
)
} }
} else if flag.required { } else if flag.required {
format!(" --{} (required parameter) {}\n", flag.long, flag.desc) format!(" --{} (required parameter) {}\n", flag.long, flag.desc)