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

use Slop "no-" prefix feature #121

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

use Slop "no-" prefix feature #121

wants to merge 2 commits into from

Conversation

no6v
Copy link
Collaborator

@no6v no6v commented May 3, 2012

Slop has a feature to invert the flag value with --no- prefix to each flag-like option,
so I tried to make options simple. If -n is specified, it will be treated it preferentially against
-l or --logo with deprecation warning.

Slop#to_hash on 3.x is broken as ever, but it will be fixed on 4.x anytime soon.
leejarvis/slop#59

* "-n" is marked as deprecated, but works preferentially
@jugyo
Copy link
Owner

jugyo commented May 3, 2012

I want to show the help like below:

  --[no-]stream       Stream mode

@no6v
Copy link
Collaborator Author

no6v commented May 3, 2012

I feel this should be as a function of Slop, but I tweaked the output of help.
Do not merge this at this time, thanks :).

@leejarvis
Copy link

opts = Slop.new do
  on 'bar', help: '  --[no-]bar   Stream mode'
end
puts opts.help #=> --[no-]bar   Stream mode

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

Successfully merging this pull request may close these issues.

None yet

3 participants