rake icon indicating copy to clipboard operation
rake copied to clipboard

Support named task arguments

Open jochenseeber opened this issue 10 years ago • 1 comments

When creating tasks that take multiple optional arguments, specifying parameters becomes tedious.

When calling the following task

task :test, [:database, :table, :column, :host, :port, :user, :password] do
    # Something
end

and specifying only parameter user, I have to count its position and call rake as follows:

rake 'test[,,,,,testuser,]'

I suggest supporting a syntax using named parameters that makes calling these tasks easier and more readable, e.g.

rake 'test{user:testuser}'

I'd like to put this up for discussion, if it is acceptable, I'm willing to create a pull request.

jochenseeber avatar Oct 28 '15 10:10 jochenseeber

Sorry, too too late response. I prefer your proposal.

hsbt avatar Nov 01 '16 12:11 hsbt