Sha256: 176b64926493b2327487342ae6986a293e36fbf7d271e864334a01f0d3d93644

Contents?: true

Size: 418 Bytes

Versions: 16

Compression:

Stored size: 418 Bytes

Contents

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

require 'cl'

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

  def run
    p to
  end
end

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

# Output:
#
#   "one"

Cl.new('owners').run(%w(add))

# Missing required option: to
#
# Usage: required add [options]
#
# Options:
#
#   --to GROUP      type: string, required: true
#   --help          Get help on this command

Version data entries

16 entries across 16 versions & 1 rubygems

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