Sha256: 609f37d5108ba92e44321757343deda627c855e6c86026bb2355d36b5dad9525

Contents?: true

Size: 423 Bytes

Versions: 53

Compression:

Stored size: 423 Bytes

Contents

require 'main'

ARGV.replace %w( 40 1 1 ) if ARGV.empty?

Main {
  argument('foo'){
    arity 3                             # foo will given three times
    cast :int                           # value cast to Fixnum
    validate{|foo| [40,1].include? foo} # raises error in failure case 
    description 'the foo param'         # shown in --help
  }

  def run
    p params['foo'].given?
    p params['foo'].values
  end
}

Version data entries

53 entries across 52 versions & 3 rubygems

Version Path
main-4.7.6 samples/b.rb
main-4.7.5 samples/b.rb
main-4.7.4 samples/b.rb
main-4.7.3 samples/b.rb
main-4.7.2 samples/b.rb
main-4.7.1 samples/b.rb
main-4.7.0 samples/b.rb
main-4.6.0 samples/b.rb
main-4.4.0 samples/b.rb
main-4.3.0 samples/b.rb
main-4.2.0 samples/b.rb
main-4.0.0 samples/b.rb
main-3.0.3 samples/b.rb
main-3.0.2 samples/b.rb
main-3.0.1 samples/b.rb
main-2.9.3 samples/b.rb
main-2.9.2 samples/b.rb
main-2.9.0 samples/b.rb
main-2.1.0 samples/b.rb
main-2.4.0 samples/b.rb