#!/usr/bin/env ruby require "como" include Como Spec.command( "como_options", "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." ], ] ) 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