diff --git a/cccli/command/command.py b/cccli/command/command.py index ca810bcbf0300bc78f62fe3b0a4055f66855e6b4..1b40c26e2b28baa01e38b72dc8f49846b2101787 100644 --- a/cccli/command/command.py +++ b/cccli/command/command.py @@ -43,6 +43,7 @@ class OptionCommand(Command): def __init__(self, cli, argv0): Command.__init__(self, cli, argv0) self.optionparser = OptionCommand.OptionCommandParser(prog=argv0) + self.set_usage("%prog [options]") self.options = None self.args = list() diff --git a/cccli/command/shell.py b/cccli/command/shell.py index 7fc55490ba4d4c08d58d6e93782a33723a115820..19c48cae98c44bd1b05492d26340f1d52c81b7e3 100644 --- a/cccli/command/shell.py +++ b/cccli/command/shell.py @@ -29,6 +29,8 @@ class Command_version(Command): class Command_history(Command): '''Show commands history''' def __call__(self, argv): + if len(argv) != 1: + raise cmdBadArgument() if not self.printer.history: raise cmdError("not available") for l in self.printer.history: @@ -39,6 +41,8 @@ class Command_clear(Command): '''Clear tty''' def __call__(self, argv): + if len(argv) != 1: + raise cmdBadArgument() self.printer.out("\033[H\033[2J", nl="")