Skip to content

Commit

Permalink
merged fix loop flag breaking everything from branch 2.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Kokonico committed Sep 6, 2024
1 parent 4e43fdc commit c6cb5b3
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions cmusic/cmusic.py
Original file line number Diff line number Diff line change
Expand Up @@ -175,16 +175,22 @@ def main():
args, unknown_args = parser.parse_known_args()

args = vars(args)
args_list = [args["command"]]
args_list += list(key for key in args.keys() if args[key] is True)

# capture any flags that were set in unknown_args
for arg in unknown_args:
all_arguments = args_list + unknown_args

# capture any flags that were set in arguments

for arg in all_arguments:
if arg.startswith("--"):
args[arg[2:]] = True
# remove the flag from the unknown_args
unknown_args.remove(arg)
elif arg.startswith("-"):
args[arg[1:]] = True
# also remove the flag from the unknown_args
unknown_args.remove(arg)

args["args"] = unknown_args

Expand Down

0 comments on commit c6cb5b3

Please sign in to comment.