Skip to content
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

Default-driven option handling #2

Closed
andymeneely opened this issue Jul 24, 2014 · 0 comments
Closed

Default-driven option handling #2

andymeneely opened this issue Jul 24, 2014 · 0 comments

Comments

@andymeneely
Copy link
Owner

The Ruby named parameters thing doesn't handle so well when we have options that override other options as in layouts. So, let's go back to using hashes in all of our API commands, but implement a more complex set of defaults

The precedence order goes like this:

  1. System-wide defaults, such as :x => 0.
  2. Command-level defaults override system-wide. e.g. `:color => :black' for text
  3. config.yml settings, wherever we support those.
  4. Settings specified by the commands themselves, e.g.text 'blah', x: 5, color: :blue

This means we'll need to change away from Ruby parameters and make use of hash merges along with input handlers that just modify the parameters.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant