svenfuchs/cl

View on GitHub
examples/readme/array

Summary

Maintainability
Test Coverage
#!/usr/bin/env ruby
$: << File.expand_path('lib')

require 'cl'

class Add < Cl::Cmd
  register :add

  opt '--to GROUP', type: :array

  def run
    p to
  end
end

Cl.new('owners').run(%w(add --to one --to two))

# Output:
#
#   ["one", "two"]