Sha256: d47b415cf3a64ca30370e61367af76c1d1405a08dd7ec4b12342dd47b695e6e9

Contents?: true

Size: 519 Bytes

Versions: 15

Compression:

Stored size: 519 Bytes

Contents

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

require 'cl'

class Add < Cl::Cmd
  opt '--retries COUNT', type: :integer, min: 1, max: 5

  def run
    p retries: retries
  end
end

Cl.new('owners').run(%w(add --retries 1))

# Output:
#
#   {:retries=>1}

Cl.new('owners').run(%w(add --retries 10))

# Output:
#
#   Out of range: retries (min: 1, max: 5)
#
#   Usage: owners add [options]
#
#   Options:
#
#     --retries COUNT      type: integer, min: 1, max: 5
#     --help               Get help on this command

Version data entries

15 entries across 15 versions & 1 rubygems

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