Commit 25e8d49d authored by Seblu's avatar Seblu
Browse files

add default usage for OptionCommand

fix args check for command clear and history
parent 2c675883
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -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()

+4 −0
Original line number Diff line number Diff line
@@ -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="")