Sha256: 3ab0e8534f0cfc0a8a597e1f70a43972121e57404112002c127b57cd74349c27

Contents?: true

Size: 642 Bytes

Versions: 16

Compression:

Stored size: 642 Bytes

Contents

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

require 'cl'

class Add < Cl::Cmd
  # read DNF, i.e. "apikey OR username AND password
  required :api_key, [:username, :password]

  opt '--api_key KEY'
  opt '--username NAME'
  opt '--password PASS'

  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/requireds
cl-0.1.27 examples/readme/requireds
cl-0.1.26 examples/readme/requireds
cl-0.1.25 examples/readme/requireds
cl-0.1.24 examples/readme/requireds
cl-0.1.23 examples/readme/requireds
cl-0.1.22 examples/readme/requireds
cl-0.1.21 examples/readme/requireds
cl-0.1.20 examples/readme/requireds
cl-0.1.19 examples/readme/requireds
cl-0.1.18 examples/readme/requireds
cl-0.1.17 examples/readme/requireds
cl-0.1.16 examples/readme/requireds
cl-0.1.15 examples/readme/requireds
cl-0.1.14 examples/readme/requireds
cl-0.1.13 examples/readme/requireds