abstract class
RemiLib::Args::Argument
- RemiLib::Args::Argument
- Reference
- Object
Overview
The base class for all Argument types for ArgParser.
Direct Known Subclasses
- RemiLib::Args::FlagArgument
- RemiLib::Args::FloatArgument
- RemiLib::Args::IntArgument
- RemiLib::Args::MultiFlagArgument
- RemiLib::Args::MultiFloatArgument
- RemiLib::Args::MultiIntArgument
- RemiLib::Args::MultiStringArgument
- RemiLib::Args::StringArgument
Defined in:
remilib/args/arg-types.crConstructors
-
.new(newLongName, shortName : Char | Nil = nil, group : String = "", help : String = "")
Initializes a new
Argumentsubclass.
Instance Method Summary
-
#callback : ArgCallbackFunc | Nil
An
ArgCallbackFuncthat will be called at the end of parsing if the argument was called. -
#callback=(callback : ArgCallbackFunc | Nil)
An
ArgCallbackFuncthat will be called at the end of parsing if the argument was called. -
#called? : Bool
Returns
trueif the argument was called after parsing, orfalseotherwise. -
#group : String
The argument group this Argument is part of.
-
#group=(group : String)
The argument group this Argument is part of.
-
#help : String
The help string for this argument, as shown during help printing.
-
#help=(help : String)
The help string for this argument, as shown during help printing.
-
#longName : String
The full argument name.
-
#longName=(newName : String) : Nil
Sets the long name of the argument.
-
#shortName : Char | Nil
The single
Charname of the argument, ornil. -
#shortName=(shortName : Char | Nil)
The single
Charname of the argument, ornil.
Instance methods inherited from class Object
toRsconf(io : IO, *, indentSize : Int = 2, alwaysQuoteKeys : Bool = false, explicitRootObject : Bool = false, commaAfterValues : Bool = false, extraNewlineBetweenToplevelKeys : Bool = false) : NiltoRsconf(*, indentSize : Int = 2, alwaysQuoteKeys : Bool = false, explicitRootObject : Bool = false, commaAfterValues : Bool = false, extraNewlineBetweenToplevelKeys : Bool = false) : String toRsconf
Class methods inherited from class Object
fromRsconf(toplevel : RemiLib::RSConf::RSValue)fromRsconf(data : String | IO | Path) fromRsconf
Constructor Detail
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.
Instance Method Detail
An ArgCallbackFunc that will be called at the end of parsing if the
argument was called.
An ArgCallbackFunc that will be called at the end of parsing if the
argument was called.
Returns true if the argument was called after parsing, or false
otherwise.
The argument group this Argument is part of. This is mainly used for help printing.
The argument group this Argument is part of. This is mainly used for help printing.
The help string for this argument, as shown during help printing.
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.
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`.
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`.