]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
rbd: nicer help output for commands without options
authorMykola Golub <mgolub@suse.com>
Sun, 7 Oct 2018 16:22:34 +0000 (19:22 +0300)
committerMykola Golub <mgolub@suse.com>
Tue, 9 Oct 2018 19:29:59 +0000 (22:29 +0300)
Signed-off-by: Mykola Golub <mgolub@suse.com>
src/test/cli/rbd/help.t
src/tools/rbd/OptionPrinter.cc

index ec3f4116c5c7cf4694571176a5bf57c81d52b665..c4a0b37f3c6bba32679e1ff88b2d1b428775661c 100644 (file)
     --image arg          image name
   
   rbd help config pool get
-  usage: rbd config pool get 
-                             <pool-name> <key> 
+  usage: rbd config pool get <pool-name> <key> 
   
   Get a pool-level configuration override.
   
     --pretty-format      pretty formatting (json and xml)
   
   rbd help config pool remove
-  usage: rbd config pool remove 
-                                <pool-name> <key> 
+  usage: rbd config pool remove <pool-name> <key> 
   
   Remove a pool-level configuration override.
   
     <key>                config key
   
   rbd help config pool set
-  usage: rbd config pool set 
-                             <pool-name> <key> <value> 
+  usage: rbd config pool set <pool-name> <key> <value> 
   
   Set a pool-level configuration override.
   
index 1033b53be703b2e59c6a295622d48e218ab46894..14affb0b3bb85192e9f3d0ac8bbaebb55ee02b24 100644 (file)
@@ -37,7 +37,10 @@ void OptionPrinter::print_short(std::ostream &os, size_t initial_offset) {
     }
     indent_stream << " ";
   }
-  indent_stream << std::endl;
+
+  if (m_optional.options().size() > 0 || m_positional.options().size() == 0) {
+    indent_stream << std::endl;
+  }
 
   if (m_positional.options().size() > 0) {
     indent_stream.set_delimiter(" ");