ArgumentParser<'Template> Type
The Argu type generates an argument parser given a type argument that is an F# discriminated union. It can then be used to parse command line arguments or XML configuration.
Constructors
Constructor | Description |
Full Usage:
ArgumentParser(?programName, ?helpTextMessage, ?usageStringCharacterWidth, ?errorHandler, ?checkStructure)
Parameters:
string
-
Program identifier, e.g. 'cat'. Defaults to the current running executable per Assembly.GetEntryAssembly() .
?helpTextMessage : string
-
Message that will be displayed at the top of the help text.
?usageStringCharacterWidth : int
-
Text width used when formatting the usage string. Defaults to 80 chars.
?errorHandler : IExiter
-
The implementation of IExiter used for error handling. Exception is default.
?checkStructure : bool
-
Indicate if the structure of the arguments discriminated union should be checked for errors.
Returns: ArgumentParser<'Template>
|
|
Instance members
Instance member | Description |
Full Usage:
this.GetArgumentCaseInfo
Parameters:
Expr<('Fields -> 'Template)>
-
Quoted union case constructor.
Returns: ArgumentCaseInfo
|
|
Full Usage:
this.GetArgumentCaseInfo
Parameters:
'Template
-
Argument instance.
Returns: ArgumentCaseInfo
|
|
Full Usage:
this.GetSubCommandParser
Parameters:
Expr<(ParseResults<'SubTemplate> -> 'Template)>
-
Expression providing the subcommand union constructor.
Returns: ArgumentParser<'SubTemplate>
|
|
Full Usage:
this.GetTag
Parameters:
'Template
-
Argument instance.
Returns: int
|
|
Full Usage:
this.Parse
Parameters:
string[]
-
The command line input. Taken from System.Environment if not specified.
?configurationReader : IConfigurationReader
-
Configuration reader used to source the arguments. Defaults to the AppSettings configuration of the current process.
?ignoreMissing : bool
-
Ignore errors caused by the Mandatory attribute. Defaults to false.
?ignoreUnrecognized : bool
-
Ignore CLI arguments that do not match the schema. Defaults to false.
?raiseOnUsage : bool
-
Treat '--help' parameters as parse errors. Defaults to true.
Returns: ParseResults<'Template>
|
|
Full Usage:
this.ParseCommandLine
Parameters:
string[]
-
The command line input. Taken from System.Environment if not specified.
?ignoreMissing : bool
-
Ignore errors caused by the Mandatory attribute. Defaults to false.
?ignoreUnrecognized : bool
-
Ignore CLI arguments that do not match the schema. Defaults to false.
?raiseOnUsage : bool
-
Treat '--help' parameters as parse errors. Defaults to true.
Returns: ParseResults<'Template>
|
|
Full Usage:
this.ParseConfiguration
Parameters:
IConfigurationReader
-
Configuration reader used to source the arguments. Defaults to the AppSettings configuration of the current process.
?ignoreMissing : bool
-
Ignore errors caused by the Mandatory attribute. Defaults to false.
Returns: ParseResults<'Template>
|
|
Full Usage:
this.PrintAppSettingsArguments
Parameters:
'Template list
-
The parameters that fill out the XML document.
?printComments : bool
-
Print XML comments over every configuration entry.
Returns: string
|
|
Full Usage:
this.PrintCommandLineArguments
Parameters:
'Template list
Returns: string[]
|
|
Full Usage:
this.PrintCommandLineArgumentsFlat
Parameters:
'Template list
Returns: string
|
|
Full Usage:
this.ProgramName
Returns: string
|
|
Full Usage:
this.ToParseResults
Parameters:
'Template seq
-
Argument input sequence.
Returns: ParseResults<'Template>
|
Static members
Static member | Description |
Full Usage:
ArgumentParser.CheckStructure()
|