Sha256: 436f48d0c4a5882ccda1cd02eb04f41aa664820233921cdcfbe127cb6790eb3e

Contents?: true

Size: 650 Bytes

Versions: 3

Compression:

Stored size: 650 Bytes

Contents

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

<%= run sq(<<-'rb')
  class Add < Cl::Cmd
    register :add

    opt '--to GROUP'
    opt '--other GROUP', requires: :to

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

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

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

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

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

  Usage: owners add [options]

  Options:

    --to GROUP         type: string
    --other GROUP      type: string, requires: to
    --help             Get help on this command
  str
%>

Version data entries

3 entries across 3 versions & 2 rubygems

Version Path
travis-cl-1.2.4 examples/_src/readme/requires.erb.rb
cl-1.2.4 examples/_src/readme/requires.erb.rb
cl-1.2.3 examples/_src/readme/requires.erb.rb