Skip to content

StartOptionParserSettings

Lunar Doggo edited this page Apr 1, 2022 · 2 revisions

What is it?

An instance of StartOptionParserSettings contains the settings a StartOptionParser should use to parse command line arguments into StartOptions and StartOptionGroups.

Implementation

public class StartOptionParserSettings : IClonable<StartOptionParserSettings>

Properties

Signature Description Default
public bool ThrowErrorOnUnknownOption { get; set; } Flag, whether an UnknownOptionNameException should be thrown if the user provides a unknown/undefined StartOption { get; set; } true
public string ShortOptionNamePrefix Prefix of short StartOption/StartOptionGroup names "-"
public string LongOptionNamePrefix { get; set; } Prefix of long StartOption/StartOptionGroup names "--"
public char MultipleValueSeparator { get; set; } Separator of multiple StartOption values ','
public char OptionValueSeparator { get; set; } Separator between StartOption name and value '='
public bool RequireStartOptionGroup { get; set; } Flag, whether an OptionRequirementException should be thrown if the user didn't provide a StartOptionGroup in the commandline parameters false

Methods

Signature Description
public StartOptionParserSettings Clone() Creates a new instance of StartOptionParserSettings with the same values

Examples

Default:

new StartOptionParserSettings();

Custom name-value and value separators:

new StartOptionParserSettings()
{
    MultipleValueSeparator = ';',
    OptionValueSeparator = ' '
};

Custom short/long name prefixes:

new StartOptionParserSettings()
{
    ShortOptionNamePrefix = '//',
    LongOptionNamePrefix = '/'
};
Clone this wiki locally