Sha256: d176bc539c13957dfdf0871a83f3ae27da55922f9907d81d3af547e91027f71c

Contents?: true

Size: 1.19 KB

Versions: 11

Compression:

Stored size: 1.19 KB

Contents

#!/usr/bin/env ruby

require "../lib/como"
include Como

Spec.command( "como_config", "Como Tester", "2013",
  [
    [ :exclusive, "doc", nil, "Documentation." ],
    [ :single, "file", "-f", "File argument." ],
    [ :switch, "debug", nil, "Enable debugging." ],
    [ :opt_single, "mode", "-m", "Mode." ],
    [ :opt_multi, "params", nil, "Parameters." ],
    [ :opt_any, "types", "-t", "Types." ],
    [ :silent, "terminator", "-", "The terminator." ],
    [ :multi, "dir", "-d", "Directory argument(s)." ],
    [ :default, "Leftovers." ],
  ], {
                  :header => "\nAdditional heading info.\n\n",
                  :footer => "\nAdditional footer info.\n\n",
                  :subcheck => false,
                  :check_missing => false,
                  :check_invalid => false,
                  :tab => 10,
                  :help_exit => false,
                  :error_exit => false,
              } )


Opt.each do |o|
    puts "Given \"#{o.name}\": #{o.given}"
    puts "Value \"#{o.name}\": #{o.value}" if o.given && o.value
end

Opt[ 'params' ].given( true ) do |o|
    o.params.each do |k,v|
        puts "Param #{k}: #{v}"
    end
end

if Opt.external
    puts "External: #{Opt.external}"
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
como-0.2.4 test/como_config
como-0.2.3 test/como_config
como-0.2.2 test/como_config
como-0.2.1 test/como_config
como-0.2.0 test/como_config
como-0.1.7 test/como_config
como-0.1.6 test/como_config
como-0.1.5 test/como_config
como-0.1.4 test/como_config
como-0.1.3 test/como_config
como-0.1.2 test/como_config