-
Notifications
You must be signed in to change notification settings - Fork 37
How do I access the command-line args in a task? #175
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
The top-level |
Do we need to support something like this:
? Or do we just pass all args to the last task mentioned? Or only allow one task to be listed on the command-line if any task args are used?
|
I think this would be confusing, as one task's args could be the name of a task: |
What do other systems do? |
I think all positional args should be task names, so task args must be --option[=]value or --flag. I think we can allow those options/flags anywhere on the line. dart-lang/core#46 discusses a mechanism to declare and be injected with args they care about (similar to unscripted), interested to get feedback on that. Grunt allows targets:
I don't think I like that as much, but it is a way to send args to a single task instead of all who use the same named options. |
One thing to note is that you may want to pass an option to a dependency task, which is not even specified on the command line. --option=value and --flag would be the ticket for that. |
target might work for me. Ultimate I want to do this:
etc So I can create a deployment workflow:
|
Let's plan on releasing 0.7.0 w/o being gated on this, but following up in an 0.7.1 to address letting tasks have args. |
sgtm. |
Now that 0.7.0 is out, I'd like to re-open. My use case is, I had a single task that wanted to take an argument. The workaround was to create two differently named tasks. In the old syntax:
But of course, I can't deal with more than one arg to a task, unless I want an explosion of task names :) So, I'd like to be able to call a task and somehow pass it args for more specialized behavior, from the command line. Thanks! |
Maybe this could help here too dart-lang/core#107 |
Just anecdotally, I ran into this use case myself this morning. I wanted to pass a single text param to a task: a new milestone version that would be re-written in a few places in the source. |
context doesn't seem to have it.
use case: I want to run something like
grind bumpversion minor
orgrind bumpversion plus
and automate the steps to bump a versionThe text was updated successfully, but these errors were encountered: