Open sethladd opened 9 years ago
The top-level grinderArgs()
is intended to expose those, but I'm pretty sure if you pass in any positional args, options, or flags that grinder doesn't understand, grinder's arg parsing will currently fail anyways. The issue for fixing that is #116.
Do we need to support something like this:
grind foo_task some args bar_task other args
? 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?
grind foo_task i get all the --args
I think this would be confusing, as one task's args could be the name of a task: grind foo_task some args bar_task other args
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. #116 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:
grunt deploy:prod
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:
grind version:bump:major
grind version:bump:minor
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:
taskBumpMajor() { bump(major); }
taskBumpMinor() { bump(minor); }
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/args#9
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 version