Open no6v opened 12 years ago
I want to show the help like below:
--[no-]stream Stream mode
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 :).
opts = Slop.new do
on 'bar', help: ' --[no-]bar Stream mode'
end
puts opts.help #=> --[no-]bar Stream mode
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