Sha256: 6fddc1739d4e453b03f8e22667cece0c3f2954a1eb84b189555cfca616f46531

Contents?: true

Size: 454 Bytes

Versions: 3

Compression:

Stored size: 454 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

3 entries across 3 versions & 1 rubygems

Version Path
cl-0.1.28 examples/readme/format
cl-0.1.27 examples/readme/format
cl-0.1.26 examples/readme/format