ruby / ruby/rake

Support named task arguments

Open
#81 1 comment 5 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Ruby
Stars
2.5k
Forks
650
Avg merge
6m
Merged PRs (30d)
3

Description

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.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

The issue names no files, tests, or entry points. Start by locating task argument parsing and invocation handling, then determine whether named arguments such as rake 'test{user:testuser}' can be supported without breaking positional syntax; done means the proposed form works for optional parameters and is covered by tests.

Written by the indexing model from the issue text.

Assessment

Tech stack
ruby
Domain
build-system, cli
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.