-
-
Notifications
You must be signed in to change notification settings - Fork 677
Add a CLI_ARGS_LIST
global variable
#2139
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
This issue has been marked as an experiment proposal! 🧪 It will now enter a period of consultation during which we encourage the community to provide feedback on the proposed design. Please see the experiment workflow documentation for more information on how we release experiments. |
Hey @pd93, I understand that having Keeping the full string is useful because makes it extremelly easy to append to a command like Also, keeping the existing as is means we wouldn't be breaking the compatibility unnecessarily. What do you think? |
@andreynering I'm not against having both. I think intuitively, I have always had the assumption that How would you handle naming? |
@pd93 That's the challenge 😂 I don't think I have a good name on top of my head at the moment. |
How about templating command to convert a "string argument list" to an "array of strings"? Then you could use that function whenever you need such a thing. You might even be able to use an existing function such as |
@trulede This already exists. See |
I totally agree with this. I use this a lot ! Having both seems the best solution |
IMHO just use that templating function. It's easy enough, and more useful, if such things are left in the hands of users to process these things as they need. |
@trulede I urge you to empathize with users, especially new users like myself. It's not at all obvious in any way that @andreynering I like the idea of having both and removing the need for a breaking change. It would mirror the behavior we see in POSIX shells, including Bash. From the Bash *
|
The consensus here was to create a new variable, so I have updated #2140 and the title/description in this issue. |
Description
When the
CLI_ARGS
variable was first introduced, Task only had string variables, so the variable was populated with a single string with shell quoted values. Since then we have introduced "any type" variables which means that arrays are now available.Instead ofAs well as joining the args together, we should make them available in an array. This makes the individual arguments easier to access and loop through without the user having to do additional processing.If the user wants a single string, they are still able to use a string joining function. However,this also adds the flexibility for users to to process arguments first or choose a separator of their own.Since this would be a breaking change, we should make this available as an experiment.Related issues:
for
withCLI_ARGS
unexpectedly splits arguments containing spaces #2138Edit: Changed this issue from a proposed experiment to edit an existing variable to a feature request for a new variable. This means it is no longer a breaking change and no longer needs to be an experiment.
The text was updated successfully, but these errors were encountered: