#!/usr/bin/env ruby require "como" include Como Spec.command( "como_rule_2", "Como Tester", "2013", [ [ :exclusive, "doc", nil, "Documentation." ], [ :opt_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." ], [ :opt_multi, "dir", "-d", "Directory argument(s)." ], [ :default, "Leftovers." ], ] ) Spec.checkRule do one( any( 'debug', 'mode' ), follow( '-', nil, '-d', meh( 'debug' ) ), incr( 'params', 'types' ), none, all( one( 'dir' ), one( 'file' ) ), ) end