Sha256: 60397a97bba976d612051182ae8d6072b4c33454c76a6734b512462990110a17
Contents?: true
Size: 1.14 KB
Versions: 3
Compression:
Stored size: 1.14 KB
Contents
#!/usr/bin/env ruby $: << File.expand_path('lib') <%= run sq(<<-'rb') require 'cl' class Required < Cl::Cmd register :required arg :one, required: true arg :two def run p cmd: registry_key, one: one, two: two end end rb -%> <%= run 'Cl.new($0).run(%w(required one two))' %> <%= out '{:cmd=>:required, :one=>"one", :two=>"two"}' %> <%= run 'Cl.new($0).run(%w(required one))' %> <%= out '{:cmd=>:required, :one=>"one", :two=>nil}' %> <%= run 'Cl.new($0).run(%w(required))' %> <%= out sq(<<-'str') Missing arguments (given: 0, required: 1) Usage: bin/examples required one [two] [options] Arguments: one type: string, required two type: string Options: --help Get help on this command str %> <%= run 'Cl.new($0).run(%w(required one two three))' %> <%= out sq(<<-'str') Too many arguments: one two three (given: 3, allowed: 2) Usage: bin/examples required one [two] [options] Arguments: one type: string, required two type: string Options: --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/args/required.erb.rb |
cl-1.2.4 | examples/_src/args/required.erb.rb |
cl-1.2.3 | examples/_src/args/required.erb.rb |