Argu


ArgumentParser<'Template>

Namespace: Argu

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

ConstructorDescription
new(...)
Signature: (programName:string option * helpTextMessage:string option * usageStringCharacterWidth:int option * errorHandler:IExiter option) -> ArgumentParser<'Template>

Creates a new parser instance based on supplied F# union template.

CompiledName: .ctor

Instance members

Instance memberDescription
GetArgumentCaseInfo(ctorExpr)
Signature: (ctorExpr:Expr<('Fields -> 'Template)>) -> ArgumentCaseInfo

Gets argument metadata for given union case constructor

GetArgumentCaseInfo(value)
Signature: value:'Template -> ArgumentCaseInfo

Gets argument metadata for given argument instance.

GetSubCommandParser(expr)
Signature: (expr:Expr<(ParseResults<'SubTemplate> -> 'Template)>) -> ArgumentParser<'SubTemplate>

Gets a subparser associated with specific subcommand instance

GetTag(value)
Signature: value:'Template -> int

Gets the F# union tag representation for given argument

Parse(...)
Signature: (inputs:string [] option * configurationReader:IConfigurationReader option * ignoreMissing:bool option * ignoreUnrecognized:bool option * raiseOnUsage:bool option) -> ParseResults<'Template>

Parse both command line args and supplied configuration reader. Results are merged with command line args overriding configuration parameters.

ParseAppSettings(...)
Signature: (assembly:Assembly * ignoreMissing:bool option) -> ParseResults<'Template>

Parse AppSettings section of XML configuration of given assembly.

ParseAppSettings(...)
Signature: (xmlConfigurationFile:string option * ignoreMissing:bool option) -> ParseResults<'Template>

Parse AppSettings section of XML configuration only.

ParseCommandLine(...)
Signature: (inputs:string [] option * ignoreMissing:bool option * ignoreUnrecognized:bool option * raiseOnUsage:bool option) -> ParseResults<'Template>

Parse command line arguments only.

ParseConfiguration(...)
Signature: (configurationReader:IConfigurationReader * ignoreMissing:bool option) -> ParseResults<'Template>

Parse arguments using specified configuration reader only. This defaults to the AppSettings configuration of the current process.

PrintAppSettingsArguments(...)
Signature: (args:'Template list * printComments:bool option) -> string

Prints parameters in App.Config format.

PrintCommandLineArguments(args)
Signature: (args:'Template list) -> string []

Prints parameters in command line format. Useful for argument string generation.

PrintCommandLineArgumentsFlat(args)
Signature: (args:'Template list) -> string

Prints parameters in command line format. Useful for argument string generation.

ToParseResults(inputs)
Signature: inputs:seq<'Template> -> ParseResults<'Template>

Converts a sequence of template argument inputs into a ParseResults instance

Fork me on GitHub