Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rework argument parsing in do/as providers
The current mechanism had a few oddities, as reported in #2811: - `rebar3 do a,b` runs `a` then `b` - `rebar3 as profile task --a=b,c` runs the task with the flag `a` set to `b,c` - `rebar3 as profile task -a b,c` runs the task with the flag `a` set to `b`, and then tries to run `c` as a task - `rebar3 as profile task -a b, c` runs the task with the flag `a` set to `b`, and then tries to run `c` as a task So the issue is that to pass a comma to an argument, we can only do so when it exists as a long form argument (`--flag`) and that it does not contain spaces. This patch attempts to correct things by making the white-space following the comma significant. If it's missing, it gets grouped as a single entity. If it's there, the task is considered to be split. This becomes significant for commands that internally parse the `,` to allow list of args (such as `rebar3 release --relnames one,two`) which were only invokable as `relnames=one,two`, and not the spaced version nor the short version (`m one,two`), which should now be supported. This should *not* break any backwards compatibility, but there is the possibility that users who did invoke many commands with both arguments and sequences without spaces (`rebar3 do release --relname a,tar`) now get broken commands. I don't quite know if we'd be okay taking that risk, so this is up for comments I guess.
- Loading branch information