Skip to content

Commit

Permalink
fix nasty bug
Browse files Browse the repository at this point in the history
  • Loading branch information
jeremyfowers committed Jul 19, 2024
1 parent e2ca4cb commit ea90941
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/turnkeyml/cli/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -185,12 +185,18 @@ def main():
else:
tools_invoked[current_tool].append(cmd.pop(0))

# Trick argparse into thinking tools was not a positional argument
# this helps to avoid an error where an incorrect arg/value pair
# can be misinterpreted as the tools positional argument
tools_action.option_strings = "--tools"

# Do one pass of parsing to figure out if -h was used
global_args = vars(parser.parse_args(tools_invoked["globals"]))

# Remove "tools" from global args because it was just there
# as a placeholder
global_args.pop("tools")
parser.parse_args(tools_invoked["globals"])

# Remove globals from the list since its already been parsed
tools_invoked.pop("globals")
evaluation_tools = []
Expand Down

0 comments on commit ea90941

Please sign in to comment.