Open rylev opened 3 weeks ago
More related links:
I was having a think about this and wondered to myself "how did this ever work in Clap 3?" Well reader, it doesn't:
$ spin up --listen --direct-mounts localhost:9876
...
Serving http://127.0.0.1:9876
Some options:
up
and extracts all known flags (and their values!) before passing on to the clap subcommand parser. This would be annoying and possibly difficult, but could probably approximately preserve the existing behavior.up
args. I don't think we necessarily need to require the --
separator here, but we still might want a validator that looks for known up
args in the trigger args list in order to give users a more useful error than the "unknown arg" that the trigger args parser would give.
We've had two failed attempts at updating our dependency on Clap from version 3 to version 4:
The issue is a breaking change from clap 3 to 4 which does not have a known work around. Clap 4 doesn't lazily evaluate args like Clap 3 did, and once it discovers an arg that can only go into the trigger_args bucket of otherwise unknown args, it starts slurping up everything else and putting it into trigger_args.
This means the following used to work but no longer does:
This does not work because as soon as --some-arg-meant-for-the-trigger is seen, everything gets lumped into trigger_args. If
--env
is put first, than things work as expected.