Sha256: 928c6f29d08a2ee7ff2a86802b91a2439e565a80e5280d307a9cc9e3df4fe4c9

Contents?: true

Size: 614 Bytes

Versions: 15

Compression:

Stored size: 614 Bytes

Contents

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

<%= run sq(<<-'rb')
    require 'cl'

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

      def run
        p retries: retries
      end
    end
  rb
-%>

<%= run "Cl.new('owners').run(%w(add --retries 1))" %>

<%= out '{:retries=>1}' %>

<%= run "Cl.new('owners').run(%w(add --retries 10))" %>

<%= out sq(<<-'str')
    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
  str
%>

Version data entries

15 entries across 15 versions & 1 rubygems

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