Skip to content

Commit

Permalink
fix cli argument parser
Browse files Browse the repository at this point in the history
  • Loading branch information
g-simmons committed Aug 9, 2024
1 parent 6997025 commit 34a8552
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions papercast/scripts/papercast.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,14 @@ def parse_arguments():
endpoint = sys.argv[1]
params = {}

key = None
for arg in sys.argv[2:]:
if arg.startswith("--"):
key = arg[2:]
if key:
params[key] = []
elif key in params: # type: ignore
params[key].append(arg) # type: ignore
elif key in params:
params[key].append(arg)
else:
print(f"Unexpected parameter {arg}.")
sys.exit(1)
Expand Down

0 comments on commit 34a8552

Please sign in to comment.