remove help command, prefer --help
This commit is contained in:
parent
f17324361c
commit
b3a71d513e
1 changed files with 5 additions and 7 deletions
|
|
@ -149,7 +149,11 @@ class ConsoleApplication(BaseApplication):
|
||||||
|
|
||||||
return line
|
return line
|
||||||
|
|
||||||
def process_command(self, command='help', *args):
|
def process_command(self, command=None, *args):
|
||||||
|
if command is None:
|
||||||
|
self._parser.print_help()
|
||||||
|
return 0
|
||||||
|
|
||||||
def f(x):
|
def f(x):
|
||||||
return x.startswith('command_' + command)
|
return x.startswith('command_' + command)
|
||||||
|
|
||||||
|
|
@ -231,11 +235,5 @@ class ConsoleApplication(BaseApplication):
|
||||||
def command(doc_string, f=register_command):
|
def command(doc_string, f=register_command):
|
||||||
return partial(f, doc_string=doc_string)
|
return partial(f, doc_string=doc_string)
|
||||||
|
|
||||||
@command("display this notice")
|
|
||||||
def command_help(self):
|
|
||||||
sys.stdout.write("Available commands:\n")
|
|
||||||
for f in self._command_help:
|
|
||||||
sys.stdout.write(' %s\n' % f)
|
|
||||||
|
|
||||||
register_command = staticmethod(register_command)
|
register_command = staticmethod(register_command)
|
||||||
command = staticmethod(command)
|
command = staticmethod(command)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue