Sha256: 43b9e1b0e2c2a8b2f6d4ad9c5a65f820a19b6e3cbe5d40c99bacba5b2dbf949c
Contents?: true
Size: 687 Bytes
Versions: 3
Compression:
Stored size: 687 Bytes
Contents
#!/usr/bin/env ruby require_relative '../lib/optimist_xl' opts = OptimistXL::options do version "cool-script v0.1 (code-name: bananas foster)" banner "This script is pretty cool." opt :juice, "use juice" opt :milk, "use milk" opt :litres, "quantity of liquid", :default => 2.0 opt :brand, "brand name of the liquid", :type => :string opt :config, "config file path", :type => String, :required => true opt :drinkers, "number of people drinking the liquid", :default => 6 end OptimistXL::die :drinkers, "must be value a greater than zero" if opts[:drinkers] < 1 OptimistXL::die :config, "must point to an existing file" unless File.exist?(opts[:config]) if opts[:config]
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
optimist_xl-3.3.0 | examples/medium_example.rb |
optimist_xl-3.2.0 | examples/medium_example.rb |
optimist_xl-3.1.1 | examples/medium_example.rb |