parent
cd41d11b85
commit
12bcbf4374
@ -331,6 +331,13 @@ def add_arguments():
|
||||
default=[]
|
||||
)
|
||||
|
||||
parser.add_argument('--json',
|
||||
help='Output data in json form rather than a python dict',
|
||||
dest='json',
|
||||
action='store_true',
|
||||
default=False
|
||||
)
|
||||
|
||||
args = parser.parse_args()
|
||||
return vars(args)
|
||||
|
||||
@ -379,8 +386,11 @@ def main(args):
|
||||
print_commands()
|
||||
return
|
||||
|
||||
print(getattr(client, command)(*args["command_arguments"]))
|
||||
|
||||
output = getattr(client, command)(*args["command_arguments"])
|
||||
if args['json']:
|
||||
print(json.dumps(output))
|
||||
else:
|
||||
print(output)
|
||||
|
||||
if __name__ == "__main__":
|
||||
args = add_arguments()
|
||||
|
Loading…
Reference in New Issue
Block a user