Sha256: 9c33d8e7480d4735d24ab72d3912ecaacbe1ba4c440bd2d2eecd113c14ab48b8

Contents?: true

Size: 361 Bytes

Versions: 16

Compression:

Stored size: 361 Bytes

Contents

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

require 'cl'

class Add < Cl::Cmd
  opt '--to GROUP', enum: %w(one two)

  def run
    p to
  end
end

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

# Output:
#
#   "one"

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

# Unknown value: to=unknown (known values: one, two)
#
# Usage: enum add [options]
#
# Options: ...

Version data entries

16 entries across 16 versions & 1 rubygems

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