Skip to content
This repository was archived by the owner on Nov 22, 2024. It is now read-only.

Commit 53af1a2

Browse files
committed
--openapi call now with optional argument as url is built into code
1 parent 5558e19 commit 53af1a2

1 file changed

Lines changed: 7 additions & 5 deletions

File tree

cli4/cli4.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -386,7 +386,8 @@ def do_it(args):
386386
output = 'json'
387387
example = False
388388
raw = False
389-
dump = False
389+
do_dump = False
390+
do_openapi = None
390391
openapi_url = None
391392
binary_file = False
392393
profile = None
@@ -453,9 +454,10 @@ def do_it(args):
453454
elif opt in ('-p', '--profile'):
454455
profile = arg
455456
elif opt in ('-d', '--dump'):
456-
dump = True
457+
do_dump = True
457458
elif opt in ('-A', '--openapi'):
458-
openapi_url = arg
459+
do_openapi = True
460+
openapi_url = arg if arg != '' else None
459461
elif opt in ('-b', '--binary'):
460462
binary_file = True
461463
elif opt in ('-G', '--get'):
@@ -481,12 +483,12 @@ def do_it(args):
481483
except Exception as e:
482484
sys.exit(e)
483485

484-
if dump:
486+
if do_dump:
485487
a = dump_commands(cf)
486488
sys.stdout.write(a)
487489
sys.exit(0)
488490

489-
if openapi_url:
491+
if do_openapi:
490492
a = dump_commands_from_web(cf, openapi_url)
491493
sys.stdout.write(a)
492494
sys.exit(0)

0 commit comments

Comments
 (0)