Formated output in long command description
authorStavros Sachtouris <saxtouri@admin.grnet.gr>
Thu, 20 Dec 2012 15:06:14 +0000 (17:06 +0200)
committerStavros Sachtouris <saxtouri@admin.grnet.gr>
Thu, 20 Dec 2012 15:06:14 +0000 (17:06 +0200)
kamaki/cli/__init__.py
kamaki/cli/argument.py
kamaki/cli/commands/pithos_cli.py

index 377b615..62b28e1 100644 (file)
@@ -302,7 +302,7 @@ def update_parser_help(parser, cmd):
         parser.syntax += ' <...>'
     if cmd.has_description:
         parser.parser.description = cmd.help\
-        + ((' . . . %s' % description) if description else '')
+        + (('\n%s' % description) if description else '')
     else:
         parser.parser.description = description
 
index cfa7f7d..fa31a28 100644 (file)
@@ -38,6 +38,7 @@ from logging import getLogger
 
 
 from argparse import ArgumentParser, ArgumentError
+from argparse import RawDescriptionHelpFormatter
 
 try:
     from progress.bar import ShadyBar as KamakiProgressBar
@@ -373,7 +374,8 @@ class ArgumentParseManager(object):
         :param arguments: (dict) if given, overrides the global _argument as
             the parsers arguments specification
         """
-        self.parser = ArgumentParser(add_help=False)
+        self.parser = ArgumentParser(add_help=False,
+            formatter_class=RawDescriptionHelpFormatter)
         self.syntax = '%s <cmd_group> [<cmd_subbroup> ...] <cmd>' % exe
         if arguments:
             self.arguments = arguments
index d563be4..d6ca1a4 100644 (file)
@@ -280,9 +280,11 @@ class _store_container_command(_store_account_command):
 @command(pithos_cmds)
 class store_list(_store_container_command):
     """List containers, object trees or objects in a directory
-    without parameters for a list of containers,
-    with one parameter (container) for the contents of a container,
-    with <container>:<prefix> for all contents starting with prefix
+    Use with:
+    1 no parameters : containers in set account
+    2. one parameter (container) or --container : contents of container
+    3. <container>:<prefix> or --container=<container> <prefix>: objects in
+        container starting with prefix
     """
 
     def __init__(self, arguments={}):