On 02/03/2012, at 2:32 AM, Daz DeBoer wrote:

> Hi guys
> 
> Following our discussion from yesterday, I was thinking that maybe a review 
> of the gradle CLI might be good for RC1.
> 
> A: The main issue is the '--refresh dependencies' option looks bad when 
> combined with the 'dependencies' task. But this would equally apply to 
> 'gradle --cache rebuild rebuild' (if rebuild was a task name).
>          - These are the only 2 options we have that take 'multi-choice' 
> arguments. All others take user-supplied arguments (like file names) or no 
> arguments. 
>          - Actually '--exclude integTest' only avoids this issue since you 
> never want explicitly execute the task you're excluding ("--exclude integTest 
> integTest" doesn't make sense!)
> Options:
> 1) Keep things as they are.
> 2) Deprecate the use of '--OPTION <space> argument' and encourage '--OPTION = 
> argument'. We could keep the ability to do '-O argument', but force the '=' 
> when using the --long-option format.
>     - This would allow us to eventually make the argument optional: eg 
> '--refresh', '--refresh=dependencies', '--refresh=task-uptodate'
> 3) Add a new pattern for a 'multi-choice' option, and switch to the syntax 
> of: '--refresh-dependencies', '--cache-rebuild'
>     - We could add these individually to start with, but later add a better 
> way to describe these in the CLI help (when we have more than a couple of 
> choices).

Let's not do 2, as '--option <space> arg' is a standard pattern supported by 
many, many command-line tools. For me, 3. is the way to go.


> 
> B: I'd also like to see is consolidation of the '--cache rebuild' and 
> '--refresh dependencies' options. (I really don't like --cache rebuild)

There's also --no-opt, which would go away (or become the 'refresh the task 
state' flag).


> Options:
> 1) Keep things as they are: (--refresh=dependencies & --cache=rebuild)
> 2) Deprecate --cache=rebuild and reuse '--refresh':
>     --refresh=task-cache
>     --refresh=task-state
>     --refresh=cached-task-state
>     --refresh=uptodate-state
>     --refresh=uptodate-cache
> 3) A new option entirely
> ????
> 
> My vote would be for A3 and B2, so we'd have '--refresh-dependencies' and 
> '--refresh-task-cache' as separate options to start with,

You'd also need --refresh-scripts option or similar.

I think I'm leaning towards something a bit more descriptive, e.g.:
    --refresh-dependencies
    --recompile-scripts
    --rerun-tasks


--
Adam Murdoch
Gradle Co-founder
http://www.gradle.org
VP of Engineering, Gradleware Inc. - Gradle Training, Support, Consulting
http://www.gradleware.com

Reply via email to