printing json by default now
This commit is contained in:
parent
56569690d9
commit
06b56544a8
@ -331,13 +331,6 @@ def add_arguments():
|
|||||||
default=[]
|
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()
|
args = parser.parse_args()
|
||||||
return vars(args)
|
return vars(args)
|
||||||
|
|
||||||
@ -386,11 +379,7 @@ def main(args):
|
|||||||
print_commands()
|
print_commands()
|
||||||
return
|
return
|
||||||
|
|
||||||
output = getattr(client, command)(*args["command_arguments"])
|
print(json.dumps(getattr(client, command)(*args["command_arguments"])))
|
||||||
if args['json']:
|
|
||||||
print(json.dumps(output))
|
|
||||||
else:
|
|
||||||
print(output)
|
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
|
Loading…
Reference in New Issue
Block a user