jugyo / earthquake

Twitter terminal client with streaming API support.
MIT License
661 stars 94 forks source link

use Slop "no-" prefix feature #121

Open no6v opened 12 years ago

no6v commented 12 years ago

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. https://github.com/injekt/slop/pull/59

jugyo commented 12 years ago

I want to show the help like below:

  --[no-]stream       Stream mode
no6v commented 12 years ago

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 commented 12 years ago
opts = Slop.new do
  on 'bar', help: '  --[no-]bar   Stream mode'
end
puts opts.help #=> --[no-]bar   Stream mode