Sha256: bae6c45d7c15846de33d5f6fd027b66aa2cabbdf494c9c851c378937e2dfc3c1

Contents?: true

Size: 441 Bytes

Versions: 13

Compression:

Stored size: 441 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
  end
end

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

# Output:
#
#   "one"

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

Invalid format: to (format: /^\w+$/)

Usage: format add [options]

Options:

  --to GROUP      type: string, format: /^\w+$/
  --help          Get help on this command

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
cl-0.1.25 examples/readme/format
cl-0.1.24 examples/readme/format
cl-0.1.23 examples/readme/format
cl-0.1.22 examples/readme/format
cl-0.1.21 examples/readme/format
cl-0.1.20 examples/readme/format
cl-0.1.19 examples/readme/format
cl-0.1.18 examples/readme/format
cl-0.1.17 examples/readme/format
cl-0.1.16 examples/readme/format
cl-0.1.15 examples/readme/format
cl-0.1.14 examples/readme/format
cl-0.1.13 examples/readme/format