1 parent 894ae11 commit 8c66d32Copy full SHA for 8c66d32
1 file changed
cli4/cli4.py
@@ -194,6 +194,8 @@ def cli4(args):
194
elif opt in ('-j', '--json'):
195
output = 'json'
196
elif opt in ('-y', '--yaml'):
197
+ if yaml is None:
198
+ exit('cli4: install yaml support')
199
output = 'yaml'
200
elif opt in ('-r', '--raw'):
201
raw = True
@@ -365,6 +367,6 @@ def cli4(args):
365
367
366
368
if output == 'json':
369
print(json.dumps(results, indent=4, sort_keys=True))
- if output == 'yaml' and yaml is not None:
370
+ if output == 'yaml':
371
print(yaml.safe_dump(results))
372
0 commit comments