abstract class RemiLib::Args::Argument

Overview

The base class for all Argument types for ArgParser.

Direct Known Subclasses

Defined in:

remilib/args/arg-types.cr

Constructors

Instance Method Summary

Constructor Detail

def self.new(newLongName, shortName : Char | Nil = nil, group : String = "", help : String = "") #

Initializes a new Argument subclass. The #longName is always required. Preprending a "--" prefix to the long name here is optional - if you don't add it yourself, it will be prepended for you by this method.


[View source]

Instance Method Detail

def callback : ArgCallbackFunc | Nil #

An ArgCallbackFunc that will be called at the end of parsing if the argument was called.


[View source]
def callback=(callback : ArgCallbackFunc | Nil) #

An ArgCallbackFunc that will be called at the end of parsing if the argument was called.


[View source]
def called? : Bool #

Returns true if the argument was called after parsing, or false otherwise.


[View source]
def group : String #

The argument group this Argument is part of. This is mainly used for help printing.


[View source]
def group=(group : String) #

The argument group this Argument is part of. This is mainly used for help printing.


[View source]
def help : String #

The help string for this argument, as shown during help printing.


[View source]
def help=(help : String) #

The help string for this argument, as shown during help printing.


[View source]
def longName : String #

The full argument name. This is always prefixed with "--".


[View source]
def longName=(newName : String) : Nil #

Sets the long name of the argument. For example, if an argument has the names --foo and '-f, then the #longNameis"--foo"and the#shortNameisf`.

If you do not include a prefix of "--", it will be prepended for you.


[View source]
def shortName : Char | Nil #

The single Char name of the argument, or nil. For example, if an argument has the names --foo and '-f, then the #longNameis"--foo"and the#shortNameisf`.


[View source]
def shortName=(shortName : Char | Nil) #

The single Char name of the argument, or nil. For example, if an argument has the names --foo and '-f, then the #longNameis"--foo"and the#shortNameisf`.


[View source]