From 42e062d7d0f80cdd4a042e1251fda45ba460458e Mon Sep 17 00:00:00 2001 From: Seblu <sebastien.luttringer@smartjog.com> Date: Thu, 10 Feb 2011 14:21:52 +0100 Subject: [PATCH] addright take index optional argument --- cccli/command/right.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/cccli/command/right.py b/cccli/command/right.py index bc82b52..23d5c15 100644 --- a/cccli/command/right.py +++ b/cccli/command/right.py @@ -50,15 +50,19 @@ class Command_addright(Command): '''Add or edit account right''' def __call__(self, argv): - if len(argv) != 5: + if len(argv) == 5: + argv.append(None) + elif len(argv) == 6: + argv[5] = int(argv[5]) + else: raise cmdBadArgument() try: - self.cli.rpc.call("addright", argv[1], argv[2], argv[3], argv[4]) + self.cli.rpc.call("addright", argv[1], argv[2], argv[3], argv[4], argv[5]) except RpcError as e: raise cmdError("RPCError: %s"%str(e)) def usage(self): - return '''Usage: addright <account tql> <right tql> <method> <target> + return '''Usage: addright <account tql> <right tql> <method> <target> [index] <method> is the name of the rpc command to allow <target> can be allow or deny''' -- GitLab