Add docstring to help command
This commit is contained in:
parent
dec8172866
commit
3458eb3ef7
|
@ -1,5 +1,6 @@
|
||||||
import logging
|
import logging
|
||||||
import sys
|
import sys
|
||||||
|
import os
|
||||||
|
|
||||||
import openerp
|
import openerp
|
||||||
from openerp import tools
|
from openerp import tools
|
||||||
|
@ -25,10 +26,13 @@ class Command(object):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
class Help(Command):
|
class Help(Command):
|
||||||
|
"""Display the list of available commands"""
|
||||||
def run(self, args):
|
def run(self, args):
|
||||||
print "Available commands:\n"
|
print "Available commands:\n"
|
||||||
|
padding = max([len(k) for k in commands.keys()]) + 2
|
||||||
for k, v in commands.items():
|
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 server
|
||||||
import deploy
|
import deploy
|
||||||
|
|
|
@ -169,6 +169,7 @@ def main(args):
|
||||||
sys.exit(rc)
|
sys.exit(rc)
|
||||||
|
|
||||||
class Server(Command):
|
class Server(Command):
|
||||||
|
"""Start the odoo server (default command)"""
|
||||||
def run(self, args):
|
def run(self, args):
|
||||||
main(args)
|
main(args)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue