Sha256: 8fdc6b46123b849154e3983d35850cdd04e33dc94986ef3130c3848f8e8bd453

Contents?: true

Size: 487 Bytes

Versions: 15

Compression:

Stored size: 487 Bytes

Contents

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

require 'cl'

class Add < Cl::Cmd
  opt '--to GROUP', format: /^\w+$/

  def run
    p to: to
  end
end

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

# Output:
#
#   {:to=>"one"}

Cl.new('owners').run(['add', '--to', 'does not match!'])

# Output:
#
#   Invalid format: to (format: /^\w+$/)
#
#   Usage: owners add [options]
#
#   Options:
#
#     --to GROUP      type: string, format: /^\w+$/
#     --help          Get help on this command

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
cl-1.2.2 examples/readme/format
cl-1.2.1 examples/readme/format
cl-1.2.0 examples/readme/format
cl-1.1.5 examples/readme/format
cl-1.1.4 examples/readme/format
cl-1.1.3 examples/readme/format
cl-1.1.2 examples/readme/format
cl-1.1.1 examples/readme/format
cl-1.1.0 examples/readme/format
cl-1.0.5 examples/readme/format
cl-1.0.4 examples/readme/format
cl-1.0.3 examples/readme/format
cl-1.0.2 examples/readme/format
cl-1.0.1 examples/readme/format
cl-1.0.0 examples/readme/format