svenfuchs/cl

View on GitHub
examples/readme/arg_array

Summary

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

require 'cl'

class Add < Cl::Cmd
  register :add

  arg :owners, type: :array, sep: ','

  def run
    p owners: owners
  end
end

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

# Output:
#
#   {:owners=>["one", "two"]}