class
CliGen::Arg
- CliGen::Arg
- Reference
- Object
Overview
This class serves as a "argument wrapper" to force a fail-fast approach to arg-parsing.
It wraps around the argument + index of the argument to do state tracking and ensure that each argument is only processed once (plus allows for easier filtering of processed arguments to avoid having to do index math)
args.reject(&.processed?) # returns the args that haven't been processed yet
It expects each argument to only be processed once and will force a raise if the argument has Arg#processed called a second time. This is to force the developer (me) to fix any processing issues during the development of this framework.
Defined in:
cligen/arg.crConstructors
Instance Method Summary
-
#index : Int32
The index of the argument in the array it was in
-
#processed
This serves as a trigger that tells the object that it has been processed
-
#processed? : Bool
The "flag"/variable that tracks is the Arg has been processed yet
-
#value : String
The raw string argument provided from the user
Constructor Detail
Instance Method Detail
This serves as a trigger that tells the object that it has been processed
This will raise an exception if it is re-called after already having been processed.