Sha256: c0bcba9fef32f89cd5576340caa5fd5564fafcb2d80abb28fb57093f2a038a72

Contents?: true

Size: 502 Bytes

Versions: 15

Compression:

Stored size: 502 Bytes

Contents

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

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

    class Add < Cl::Cmd
      # depending on its arity the block can receive:
      #
      # * value
      # * value, name
      # * value, name, type
      # * value, name, type, opts
      opt '--to GROUP' do |value|
        opts[:to] = "group-#{value}"
      end

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

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

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

Version data entries

15 entries across 15 versions & 1 rubygems

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