Move flags help to last

This commit is contained in:
Jonathan Turner 2019-11-06 15:28:26 +13:00
parent 15c6d24178
commit 44a1686a76

View file

@ -61,9 +61,6 @@ impl PerItemCommand for Help {
let mut one_liner = String::new(); let mut one_liner = String::new();
one_liner.push_str(&signature.name); one_liner.push_str(&signature.name);
one_liner.push_str(" "); one_liner.push_str(" ");
if signature.named.len() > 0 {
one_liner.push_str("{flags} ");
}
for positional in &signature.positional { for positional in &signature.positional {
match &positional.0 { match &positional.0 {
@ -80,6 +77,10 @@ impl PerItemCommand for Help {
one_liner.push_str(&format!(" ...args",)); one_liner.push_str(&format!(" ...args",));
} }
if signature.named.len() > 0 {
one_liner.push_str("{flags} ");
}
long_desc.push_str(&format!("\nUsage:\n > {}\n", one_liner)); long_desc.push_str(&format!("\nUsage:\n > {}\n", one_liner));
if signature.positional.len() > 0 || signature.rest_positional.is_some() { if signature.positional.len() > 0 || signature.rest_positional.is_some() {