Argsparse
Loading...
Searching...
No Matches
Argparse.Argument< C, V > Class Template Referencesealed
Inheritance diagram for Argparse.Argument< C, V >:
Argparse.IArgument< C >

Properties

required string Description [get]
 Description of the argument as it should appear in help write-up.
 
string ValuePlaceholder = "<arg>" [get]
 Value placeholder will be used in synopsis and appear in help write-up, e.g. program [options] <value-placeholder> ... value-placeholder Description of the argument.
 
required Func< string, V > Converter [get]
 Function to convert the argument value parsed as a string from the input to the target type.
 
required Action< C, V > Action [get]
 This action is run for every value parsed from the input, e.g. when the argument is specified to have 3 values and is required, this action will be run exactly 3 times.
 
ArgumentMultiplicity Multiplicity = new ArgumentMultiplicity.SpecificCount(Number: 1, IsRequired: true) [get]
 Codifies information about what number or range of numbers of parts for this argument is to be expected.Defaults to ArgumentMultiplicity.SpecificCount with ArgumentMultiplicity.SpecificCount.Number set to 1 and ArgumentMultiplicity.SpecificCount.IsRequired set to true.
 

Property Documentation

◆ Action

required Action<C, V> Argparse.Argument< C, V >.Action
get

This action is run for every value parsed from the input, e.g. when the argument is specified to have 3 values and is required, this action will be run exactly 3 times.

Converters may throw exceptions, they will be caught and the parser will throw ParserConversionException

◆ Converter

required Func<string, V> Argparse.Argument< C, V >.Converter
get

Function to convert the argument value parsed as a string from the input to the target type.

Converters may throw exceptions, they will be caught and the parser will throw ParserConversionException

Some of the basic converters are available in ConverterFactory

It is good practice to not use converters to store the value or manipulate outer state.

◆ Description

required string Argparse.Argument< C, V >.Description
get

Description of the argument as it should appear in help write-up.

Implements Argparse.IArgument< C >.

◆ Multiplicity

ArgumentMultiplicity Argparse.Argument< C, V >.Multiplicity = new ArgumentMultiplicity.SpecificCount(Number: 1, IsRequired: true)
get

Codifies information about what number or range of numbers of parts for this argument is to be expected.Defaults to ArgumentMultiplicity.SpecificCount with ArgumentMultiplicity.SpecificCount.Number set to 1 and ArgumentMultiplicity.SpecificCount.IsRequired set to true.

Implements Argparse.IArgument< C >.

◆ ValuePlaceholder

string Argparse.Argument< C, V >.ValuePlaceholder = "<arg>"
get

Value placeholder will be used in synopsis and appear in help write-up, e.g. program [options] <value-placeholder> ... value-placeholder Description of the argument.

Implements Argparse.IArgument< C >.


The documentation for this class was generated from the following file: