diff --git a/cccli/command/right.py b/cccli/command/right.py index 005c3de09c08aba9a016d7708547c861592c5379..bc82b523acad23d00e4b86dc862d25cd89dd1b55 100644 --- a/cccli/command/right.py +++ b/cccli/command/right.py @@ -68,12 +68,20 @@ class Command_delright(Command): '''Delete account right''' def __call__(self, argv): - if len(argv) != 3: + if len(argv) < 3: raise cmdBadArgument() - try: - self.cli.rpc.call("delright", argv[1], int(argv[2])) - except RpcError as e: - raise cmdError("RPCError: %s"%str(e)) + l = argv[2:] + if "*" in l: + try: + self.cli.rpc.call("delright", argv[1], None) + except RpcError as e: + raise cmdError("RPCError: %s"%str(e)) + else: + for index in l: + try: + self.cli.rpc.call("delright", argv[1], int(index)) + except RpcError as e: + raise cmdError("RPCError: %s"%unicode(e)) def usage(self): - return "Usage: delright <account> <index>" + return "Usage: delright <tql> <index> ...\n\nindex * means all"