#!/usr/bin/env ruby $: << File.expand_path('lib') require 'cl' class Add < Cl::Cmd register :add opt '--to GROUP', alias: :group def run # p opts: opts, to: to, to?: to?, group: group, group?: group? p opts: opts, to: to, to?: to? end end Cl.new('owners').run(%w(add --group one)) # Output: # # {:opts=>{:to=>"one", :group=>"one"}, :to=>"one", :to?=>true}