summary refs log tree commit diff
path: root/src/argument.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/argument.rs')
-rw-r--r--src/argument.rs36
1 files changed, 21 insertions, 15 deletions
diff --git a/src/argument.rs b/src/argument.rs
index 02e97f0..26950a9 100644
--- a/src/argument.rs
+++ b/src/argument.rs
@@ -376,28 +376,34 @@ pub fn print_help(program_name: &str, required_arg: &str, args: &[Argument]) {
         return;
     }
     println!("Argument{}:", if args.len() > 1 { "s" } else { "" });
+
     for arg in args {
-        match arg.short {
-            Some(s) => print!(" -{}, ", s),
-            None => print!("     "),
+        println!();
+
+        if let Some(s) = arg.short {
+            print!(" -{}", s);
+            if !arg.long.is_empty() {
+                print!(",");
+            }
         }
-        if arg.long.is_empty() {
-            print!("  ");
-        } else {
-            print!("--");
+
+        print!(" ");
+
+        if !arg.long.is_empty() {
+            print!("--{}", arg.long);
         }
-        print!("{:<12}", arg.long);
+
         if let Some(v) = arg.value {
-            if arg.long.is_empty() {
-                print!(" ");
-            } else {
+            if !arg.long.is_empty() {
                 print!("=");
             }
-            print!("{:<10}", v);
-        } else {
-            print!("{:<11}", "");
+            print!("{}", v);
+        }
+
+        println!();
+        for line in arg.help.lines() {
+            println!("    {}", line);
         }
-        println!("{}", arg.help);
     }
 }