Skip to content

Commit

Permalink
add exmaple
Browse files Browse the repository at this point in the history
  • Loading branch information
joshbuddy committed Aug 21, 2010
1 parent 8f9e440 commit c28b724
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Gemfile.lock
@@ -1,7 +1,7 @@
PATH
remote: .
specs:
optitron (0.0.11)
optitron (0.1.0)
callsite (= 0.0.4)
ruby2ruby (= 1.2.4)
ruby_parser (>= 2.0)
Expand Down
15 changes: 15 additions & 0 deletions examples/cli.rb
@@ -0,0 +1,15 @@
require 'optitron'

class Runner < Optitron::CLI
class_opt 'verbose'
class_opt 'environment', :in => %w(production stage development test), :default => 'development'
class_opt 'volume', :in => 1..10

desc "Install stuff"
opt 'force'
def install(file, source = ".")
puts "Installing #{file} from #{source.inspect} with params: #{params.inspect}"
end
end

Runner.dispatch

0 comments on commit c28b724

Please sign in to comment.