diff --git a/cccli/cli.py b/cccli/cli.py index f97cf86796adcb1b11722e883b79c40a9793e157..6a579b45e34a980d3d70677254b57f403183a092 100644 --- a/cccli/cli.py +++ b/cccli/cli.py @@ -149,7 +149,7 @@ class Cli(object): self.printer.error("Bad argument.") usage = self.commands.usage(argv[0]) if usage != "": - self.printer.out("usage: %s."%usage) + self.printer.out(usage) except cmdBadName: self.printer.error("No command: %s."%argv[0]) except cmdWarning as e: diff --git a/cccli/command/right.py b/cccli/command/right.py index 65c2a211f1896894af4efb1e9cdfe892de9a6df6..cf99069f27ff00ce8252760d8d7c7c087b0cb6e6 100644 --- a/cccli/command/right.py +++ b/cccli/command/right.py @@ -13,7 +13,7 @@ from cccli.command.command import Command from optparse import OptionParser class Command_rights(Command): - '''List account rights (current by default)''' + '''List account rights''' def __call__(self, argv): # Parse argline @@ -49,7 +49,7 @@ class Command_rights(Command): class Command_addright(Command): - '''Add/edit a right''' + '''Add or edit account right''' def __call__(self, argv): if len(argv) != 5: @@ -60,11 +60,14 @@ class Command_addright(Command): raise cmdError("RPCError: %s"%str(e)) def usage(self): - return "Usage: addright <tql> <right tql> <method> <target>" + return '''Usage: addright <account tql> <right tql> <method> <target> + +<method> is the name of the rpc command to allow +<target> can be allow or deny''' class Command_delright(Command): - '''Delete a right''' + '''Delete account right''' def __call__(self, argv): if len(argv) != 3: diff --git a/cccli/command/shell.py b/cccli/command/shell.py index 5a78f54988d87948e036285d53ba510e1cf311c2..b80d7f0fb9deaa9947724f3256ae8c6d239d3ddb 100644 --- a/cccli/command/shell.py +++ b/cccli/command/shell.py @@ -14,6 +14,7 @@ class Command_quit(Command): def __call__(self, argv): raise SystemExit() + class Command_version(Command): '''Print cli version''' def __call__(self, argv): @@ -52,8 +53,10 @@ class Command_help(Command): elif len(argv) == 2: if argv[1] not in self.cli.commands: raise cmdBadArgument(argv[1]) - self.printer.out(self.cli.commands.help(argv[1])) - self.printer.out(self.cli.commands.usage(argv[1])) + c = self.cli.commands + for u in (c.help(argv[1]), c.usage(argv[1])): + if u != "": + self.printer.out(u) else: raise cmdBadArgument()