![]() |
DotNet-Arguments 2.0.0
A simple and 'to-the-point' library to parse launch arguments in .NET and .NET Core applications.
|
Class Verb
models a verb that can be given in launch arguments to select a specific action or subset of usable launch parameters.
More...
Public Member Functions | |
Verb (string name, string description="") | |
Constructs an independant Verb with the given parameters. More... | |
Verb | RegisterVerb (Verb verb) |
Attempts to register a sub-Verb in the current Verb. More... | |
Verb | RegisterOption (Option option) |
Attempts to register an Option in the current Verb. More... | |
Verb | RegisterOptionRecursively (Option option, bool ignoreDuplicates=false) |
Attempts to register an Option in the current Verb and all its sub-Verb in a recursive manner. More... | |
Verb | GetSubVerbByName (string name) |
Attempts to retrieve a registered sub-Verb using its name. More... | |
Option | GetRelevantDefaultOption () |
Attempts to retrieve the default Option that should be used during the parsing process based on whether it has been used before. More... | |
Option | GetOptionByToken (char token) |
Attempts to retrieve a registered Option using its token. More... | |
Option | GetOptionByName (string name) |
Attempts to retrieve a registered Option using its name. More... | |
bool | HasOptionByToken (char token) |
Checks if a given token is used by a registered Option. More... | |
bool | HasOptionByName (string name) |
Checks if a given name is used by a registered Option. More... | |
void | Clear () |
Clears any field and registered member's fields that may be modified once the launch arguments are parsed. More... | |
Public Attributes | |
readonly string | Description |
Description as shown in the help text. May be left as null . More... | |
readonly string | Name |
Name used when searching for a sub-Verb or rendering the help text. May be left as null if it has no parent and is the root. More... | |
readonly List< Option > | Options |
List of Option registered via the Verb.RegisterOption function. More... | |
readonly List< Verb > | Verbs |
List of sub-Verb registered via the Verb.RegisterVerb function. More... | |
Verb | ParentVerb |
Reference to a potential parent Verb in which this one was registered. May be left as null to indicate that it has no parent and is the root. More... | |
bool | WasUsed |
Flag used to indicate if the Verb was used at any point during the parsing process. More... | |
Class Verb
models a verb that can be given in launch arguments to select a specific action or subset of usable launch parameters.
|
inline |
|
inline |
Clears any field and registered member's fields that may be modified once the launch arguments are parsed.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Attempts to register an Option in the current Verb.
option | The Option to register in Verb.Verbs. |
Exceptions.DuplicateOptionException | If the given Option or one with the same token/name is already registered. |
Exceptions.ExistingDefaultMultipleOptionException | If the given Option has the Default flag and is registered after one that also has OptionFlags.Default, OptionFlags.HasValue and OptionFlags.Repeatable flags. |
|
inline |
Attempts to register an Option in the current Verb and all its sub-Verb in a recursive manner.
option | The Option to register in Verb.Verbs. |
ignoreDuplicates | Prevents exceptions from being raised if an Option with the same token or name is encountered. Default: false |
Exceptions.DuplicateOptionException | If the given Option or one with the same token/name is already registered. Will not be thrown if ignoreDuplicates is set to true . |
Exceptions.ExistingDefaultMultipleOptionException | If the given Option has the Default flag and is registered after one that also has OptionFlags.Default, OptionFlags.HasValue and OptionFlags.Repeatable flags. |
Attempts to register a sub-Verb in the current Verb.
verb | The Verb to register in Verb.Verbs as a sub-Verb. |
Exceptions.InvalidVerbNameException | If the registered Verb's name is empty or null. |
Exceptions.DuplicateVerbException | If the given Verb or one with the same name is already registered. |
readonly string NibblePoker.Library.Arguments.Verb.Description |
Description as shown in the help text.
May be left as null
.
readonly string NibblePoker.Library.Arguments.Verb.Name |
Name used when searching for a sub-Verb or rendering the help text.
May be left as null
if it has no parent and is the root.
readonly List<Option> NibblePoker.Library.Arguments.Verb.Options |
List of Option registered via the Verb.RegisterOption function.
Verb NibblePoker.Library.Arguments.Verb.ParentVerb |
Reference to a potential parent Verb in which this one was registered.
May be left as null
to indicate that it has no parent and is the root.
readonly List<Verb> NibblePoker.Library.Arguments.Verb.Verbs |
List of sub-Verb registered via the Verb.RegisterVerb function.
bool NibblePoker.Library.Arguments.Verb.WasUsed |
Flag used to indicate if the Verb was used at any point during the parsing process.