injekt/slop — Issue #38: 2.4.0 command not working
Author: epinault-ttc
Created: 2011-11-30 17:19:18+00:00
State: open

I am trying the example

require 'slop'

opts = Slop.new do
command :clean do
on :v, :verbose, do
puts 'Enabled verbose mode for clean'
end
end

# non-command specific options
on :v, :version do
puts 'version 1'
end
end

puts opts.to_hash

and I see nothing being outputted

~$ ruby slop.rb
{:version=>nil}
~$ ruby slop.rb -v
{:version=>nil}
~$ ruby slop.rb clean -v
{:version=>nil}
~s$ ruby slop.rb clean -v
{:version=>nil}

I am using ruby 1.9.2 on Ubuntu 10.04