class

Cling::Argument

Inherits Reference < Object

Represents a command line argument, this can be a single value or a string value. Arguments are parsed after the main command and any subcommands are resolved. Note that Options that have values take priority in the resolution list, so the following example would only yield 2 arguments:

./greet --time=day Dev
#              ^^^
# belongs to the flag option

Arguments should typically be defined in the Command#setup method of a command using Command#add_argument to prevent conflicts.

Constructors

new(name : String, description : String | Nil = nil, required : Bool = false, multiple : Bool = false, hidden : Bool = false)
Source

Instance methods

description
Source
description=(description : String | Nil)
Source
hidden=(hidden : Bool)
Source
hidden?
Source
multiple=(multiple : Bool)
Source
multiple?
Source
name
Source
name=(name : String)
Source
required=(required : Bool)
Source
required?
Source
to_s(io : IO) : Nil

Appends a short String representation of this object which includes its class name and its object address.

class Person
  def initialize(@name : String, @age : Int32)
  end
end

Person.new("John", 32).to_s # => #<Person:0x10a199f20>
Source
value
Source
value=(value : Value | Nil)
Source