make cli format a bit saner

this looks more like pve/pmg cli tools now
without double the empty lines

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
This commit is contained in:
Dominik Csapak 2020-03-18 16:27:38 +01:00 committed by Wolfgang Bumiller
parent d84f563d5b
commit d1bfafe157
2 changed files with 2 additions and 4 deletions

View File

@ -144,10 +144,10 @@ pub fn generate_usage_str(
let mut text = match format { let mut text = match format {
DocumentationFormat::Short => { DocumentationFormat::Short => {
return format!("{}{}{}{}\n\n", indent, prefix, args, option_indicator); return format!("{}{}{}{}\n", indent, prefix, args, option_indicator);
} }
DocumentationFormat::Long => { DocumentationFormat::Long => {
format!("{}{}{}{}\n\n", indent, prefix, args, option_indicator) format!("{}{}{}{}\n", indent, prefix, args, option_indicator)
} }
DocumentationFormat::Full => format!( DocumentationFormat::Full => format!(
"{}{}{}{}\n\n{}\n\n", "{}{}{}{}\n\n{}\n\n",
@ -166,7 +166,6 @@ pub fn generate_usage_str(
if !options.is_empty() { if !options.is_empty() {
text.push_str("Optional parameters:\n\n"); text.push_str("Optional parameters:\n\n");
text.push_str(&options); text.push_str(&options);
text.push('\n');
} }
text text
} }

View File

@ -150,7 +150,6 @@ pub fn get_property_description(
let indent = " "; let indent = " ";
text.push('\n'); text.push('\n');
text.push_str(&wrap_text(indent, indent, descr, 80)); text.push_str(&wrap_text(indent, indent, descr, 80));
text.push('\n');
text text
} }