Sha256: efbc4124485f888710997a8dd17185cac114190f51bbb8cff3df836bb4c0e65d

Contents?: true

Size: 1.13 KB

Versions: 1

Compression:

Stored size: 1.13 KB

Contents

#!/usr/bin/env ruby

require "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 => "Addition heading info.",
                  :footer => "Addition footer info.",
                  :subcheck => false,
                  :check_missing => false,
                  :tab => 10,
                  :help_exit => false,
                  :error_exit => false,
              } )


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

Opt.each_given do |o|
    puts "Value \"#{o.name}\": #{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

1 entries across 1 versions & 1 rubygems

Version Path
como-0.1.0 test/como_config