Sha256: 4d9f2d85370c5e51cbdffaa6c0d616349cbf247a5fbd2b7cc743850d30480e38

Contents?: true

Size: 531 Bytes

Versions: 16

Compression:

Stored size: 531 Bytes

Contents

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

require 'cl'

class Add < Cl::Cmd
  opt '--to GROUP'
  opt '--retries INT', requires: :to

  def run
    p to, retries
  end
end

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

# Output:
#
#   "one"
#   1

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

# Missing option: to (required by retries)
#
# Usage: requires add [options]
#
# Options:
#
#   --to GROUP         type: string
#   --retries INT      type: string, requires: to
#   --help             Get help on this command

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
cl-0.1.28 examples/readme/requires
cl-0.1.27 examples/readme/requires
cl-0.1.26 examples/readme/requires
cl-0.1.25 examples/readme/requires
cl-0.1.24 examples/readme/requires
cl-0.1.23 examples/readme/requires
cl-0.1.22 examples/readme/requires
cl-0.1.21 examples/readme/requires
cl-0.1.20 examples/readme/requires
cl-0.1.19 examples/readme/requires
cl-0.1.18 examples/readme/requires
cl-0.1.17 examples/readme/requires
cl-0.1.16 examples/readme/requires
cl-0.1.15 examples/readme/requires
cl-0.1.14 examples/readme/requires
cl-0.1.13 examples/readme/requires