Sha256: f418ba831bd781cb4a322c88ab03c3e7861475726ba664ac22bc5c52943cf66e

Contents?: true

Size: 520 Bytes

Versions: 13

Compression:

Stored size: 520 Bytes

Contents

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

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

  class Add < Cl::Cmd
    opt '--to GROUP', required: true

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

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

<%= out '{:to=>"one"}' %>

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

<%= out sq(<<-'str')
  Missing required option: to

  Usage: owners add [options]

  Options:

    --to GROUP      type: string, required: true
    --help          Get help on this command
  str
%>

Version data entries

13 entries across 13 versions & 1 rubygems

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