Add docstring to help command
authorFabien Meghazi <fme@openerp.com>
Tue, 27 May 2014 15:07:40 +0000 (17:07 +0200)
committerFabien Meghazi <fme@openerp.com>
Tue, 27 May 2014 15:07:40 +0000 (17:07 +0200)
openerp/cli/__init__.py
openerp/cli/server.py

index 71e2ae8..2f9caad 100644 (file)
@@ -1,5 +1,6 @@
 import logging
 import sys
+import os
 
 import openerp
 from openerp import tools
@@ -25,10 +26,13 @@ class Command(object):
         pass
 
 class Help(Command):
+    """Display the list of available commands"""
     def run(self, args):
         print "Available commands:\n"
+        padding = max([len(k) for k in commands.keys()]) + 2
         for k, v in commands.items():
-            print "    %s" % k
+            print "    %s%s" % (k.ljust(padding, ' '), v.__doc__ or '')
+        print "\nUse '%s <command> --help' for individual command help." % sys.argv[0].split(os.path.sep)[-1]
 
 import server
 import deploy
index 5d731a9..7060263 100644 (file)
@@ -169,6 +169,7 @@ def main(args):
     sys.exit(rc)
 
 class Server(Command):
+    """Start the odoo server (default command)"""
     def run(self, args):
         main(args)