Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

add exmaple

  • Loading branch information...
commit c28b724f67f8ec541300a64cd365ddb3824af3a2 1 parent 8f9e440
@joshbuddy authored
Showing with 16 additions and 1 deletion.
  1. +1 −1  Gemfile.lock
  2. +15 −0 examples/cli.rb
View
2  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)
View
15 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
Please sign in to comment.
Something went wrong with that request. Please try again.