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

Issues with multi word options #11

Open
tf opened this issue May 26, 2017 · 0 comments
Open

Issues with multi word options #11

tf opened this issue May 26, 2017 · 0 comments

Comments

@tf
Copy link
Contributor

tf commented May 26, 2017

When declaring options like

on '--redis-host'

the member set on the options OpenStruct is redis-host which is not a valid Ruby identifier. It thus has to be accessed as options['redis-host']. Even worse on Ruby 1.9 - if one still wishes to support that - OpenStruct does not implement []. So one has to resort to options.send('redis-host').

I'd suggest to always also set redis_host, i.e. the option name with hyphens replaced by underscores, so that multi word options can be accessed as options.redis_host

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

No branches or pull requests

1 participant