Sha256: 8656576a6fe25ff7579753b93f842f2261f803e0ee7e9e783c7862c28b6001c6
Contents?: true
Size: 554 Bytes
Versions: 53
Compression:
Stored size: 554 Bytes
Contents
require 'main' ARGV.replace %w( --foo=40 -f2 ) if ARGV.empty? Main { option('foo', 'f'){ required # by default options are not required, we could use 'foo=foo' # above as a shortcut argument_required arity 2 cast :float } option('bar=[bar]', 'b'){ # note shortcut syntax for optional args # argument_optional # we could also use this method cast :bool default false } def run p params['foo'].given? p params['foo'].values p params['bar'].given? p params['bar'].value end }
Version data entries
53 entries across 52 versions & 3 rubygems