Skip to content
Snippets Groups Projects
Commit 1fc2480d authored by Seblu's avatar Seblu
Browse files

delright can take a list of index or delete all with *

parent 34e7efe8
No related branches found
No related tags found
No related merge requests found
......@@ -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"
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment