When parsing multiple args passed via cli, we aren't properly consuming them and an error is raise even though the hook has multiple arg mappers. Issue is when we parse the args in run_declarative_hook, we iterate through the args and first check if the arg is a ref to a method, upgrade the hook if it is, then in the same loop evaluate_args which does not properly consume the arg and thus we are left with args. Issue has to do with the following:
evaluate_args -> this does not pop the first consumed arg - only the last one
run_declarative_hook -> this runs evaluate_args multiple times in a loop and thus only consumes the last arg but is not suitable for many args
Solution could be:
Break up evaluate_args into evaluate_single_arg and force it to consume each arg
In run_declarative_hook - only run evaluate_single_arg since there is already a loop needed to do the method upgrade
As some house cleaning, also should breakup the sections of run_declarative_hook into evaluate_dcl_hook_kwargs/args to make it more legible. evaluate_dcl_hook_args will mirror evaluate_args in that it loops through the args but doesn't upgrade a hook if it is a method.
When parsing multiple args passed via cli, we aren't properly consuming them and an error is raise even though the hook has multiple arg mappers. Issue is when we parse the args in
run_declarative_hook
, we iterate through the args and first check if the arg is a ref to a method, upgrade the hook if it is, then in the same loopevaluate_args
which does not properly consume the arg and thus we are left with args. Issue has to do with the following:Solution could be:
As some house cleaning, also should breakup the sections of run_declarative_hook into evaluate_dcl_hook_kwargs/args to make it more legible. evaluate_dcl_hook_args will mirror evaluate_args in that it loops through the args but doesn't upgrade a hook if it is a method.