Argu


ParseResults<'Template> Type

Namespace: Argu

Assembly: Argu.dll


Base Type: obj

All Interfaces:

  • IComparable
  • IParseResult

Argument parsing result holder.

Instance members

Instance member Description
this.Catch(f, ?errorCode, ?showUsage)
Full Usage:
this.Catch(f, ?errorCode, ?showUsage) Parameter Types:
  • f : unit -> 'T
  • ?errorCode : ErrorCode
  • ?showUsage : bool

Return Type: 'T
Signature: (f: (unit -> 'T) * errorCode: ErrorCode * showUsage: bool) -> 'T

Handles any raised exception through the argument parser's exiter mechanism. Display usage optionally.

Parameters

f

The operation to be executed.

errorCode

The error code to be returned.

showUsage

Print usage together with error message.


Parameter Types:
  • f : unit -> 'T
  • ?errorCode : ErrorCode
  • ?showUsage : bool
Return Type: 'T
this.Contains(expr, ?source)
Full Usage:
this.Contains(expr, ?source) Parameter Types:
  • expr : Expr<('Fields -> 'Template)>
  • ?source : ParseSource

Return Type: bool
Signature: (expr: Expr<('Fields -> 'Template)> * source: ParseSource) -> bool

Checks if parameter of specific kind has been specified.

Parameters

expr

The name of the parameter, expressed as quotation of DU constructor.

source

Optional source restriction: AppSettings or CommandLine.


Parameter Types:
  • expr : Expr<('Fields -> 'Template)>
  • ?source : ParseSource
Return Type: bool
this.Contains(expr, ?source)
Full Usage:
this.Contains(expr, ?source) Parameter Types:
  • expr : Expr<'Template>
  • ?source : ParseSource

Return Type: bool
Signature: (expr: Expr<'Template> * source: ParseSource) -> bool

Checks if parameter of specific kind has been specified.

Parameters

expr

The name of the parameter, expressed as quotation of DU constructor.

source

Optional source restriction: AppSettings or CommandLine.


Parameter Types:
  • expr : Expr<'Template>
  • ?source : ParseSource
Return Type: bool
this.ErrorHandler
Full Usage:
this.ErrorHandler
Return Type: IExiter
Signature: IExiter
Return Type: IExiter
this.GetAllResults(?source)
Full Usage:
this.GetAllResults(?source) Parameter Types:
  • ?source : ParseSource

Return Type: 'Template list
Signature: (source: ParseSource) -> 'Template list

Gets all parse results.

Parameters

source

Optional source restriction: AppSettings or CommandLine.


Parameter Types:
  • ?source : ParseSource
Return Type: 'Template list
this.GetResult(expr, ?defaultValue, ?source)
Full Usage:
this.GetResult(expr, ?defaultValue, ?source) Parameter Types:
  • expr : Expr<('Fields -> 'Template)>
  • ?defaultValue : 'Fields
  • ?source : ParseSource

Return Type: 'Fields
Signature: (expr: Expr<('Fields -> 'Template)> * defaultValue: 'Fields * source: ParseSource) -> 'Fields

Returns the *last* specified parameter of given type. Command line parameters have precedence over AppSettings parameters.

Parameters

expr

The name of the parameter, expressed as quotation of DU constructor.

defaultValue

Return this of no parameter of specific kind has been specified.

source

Optional source restriction: AppSettings or CommandLine.


Parameter Types:
  • expr : Expr<('Fields -> 'Template)>
  • ?defaultValue : 'Fields
  • ?source : ParseSource
Return Type: 'Fields
this.GetResult(expr, ?defaultValue, ?source)
Full Usage:
this.GetResult(expr, ?defaultValue, ?source) Parameter Types:
  • expr : Expr<'Template>
  • ?defaultValue : 'Template
  • ?source : ParseSource

Return Type: 'Template
Signature: (expr: Expr<'Template> * defaultValue: 'Template * source: ParseSource) -> 'Template

Returns the *last* specified parameter of given type. Command line parameters have precedence over AppSettings parameters.

Parameters

expr

The name of the parameter, expressed as quotation of DU constructor.

defaultValue

Return this of no parameter of specific kind has been specified.

source

Optional source restriction: AppSettings or CommandLine.


Parameter Types:
  • expr : Expr<'Template>
  • ?defaultValue : 'Template
  • ?source : ParseSource
Return Type: 'Template
this.GetResults(expr, ?source)
Full Usage:
this.GetResults(expr, ?source) Parameter Types:
  • expr : Expr<('Fields -> 'Template)>
  • ?source : ParseSource

Return Type: 'Fields list
Signature: (expr: Expr<('Fields -> 'Template)> * source: ParseSource) -> 'Fields list

Query parse results for argument with parameters.

Parameters

expr

The name of the parameter, expressed as quotation of DU constructor.

source

Optional source restriction: AppSettings or CommandLine.


Parameter Types:
  • expr : Expr<('Fields -> 'Template)>
  • ?source : ParseSource
Return Type: 'Fields list
this.GetResults(expr, ?source)
Full Usage:
this.GetResults(expr, ?source) Parameter Types:
  • expr : Expr<'Template>
  • ?source : ParseSource

Return Type: 'Template list
Signature: (expr: Expr<'Template> * source: ParseSource) -> 'Template list

Query parse results for parameterless argument.

Parameters

expr

The name of the parameter, expressed as quotation of DU constructor.

source

Optional source restriction: AppSettings or CommandLine.


Parameter Types:
  • expr : Expr<'Template>
  • ?source : ParseSource
Return Type: 'Template list
this.GetSubCommand()
Full Usage:
this.GetSubCommand()
Return Type: 'Template
Signature: unit -> 'Template

Attempts to recover the subcommand parameter from the results, if one has been specified.


Return Type: 'Template
this.IsUsageRequested
Full Usage:
this.IsUsageRequested
Return Type: bool
Signature: bool

Returns true if '--help' parameter has been specified in the command line.


Return Type: bool
this.IterResult(expr, iterator, ?source)
Full Usage:
this.IterResult(expr, iterator, ?source) Parameter Types:
  • expr : Expr<('Field -> 'Template)>
  • iterator : 'Field -> unit
  • ?source : ParseSource

Signature: (expr: Expr<('Field -> 'Template)> * iterator: ('Field -> unit) * source: ParseSource) -> unit

Iterates through the *last* parse result for a given argument kind. Command line parameters have precedence over AppSettings parameters. Results are passed to an iterator function that is error handled by the parser.

Parameters

expr

The name of the parameter, expressed as quotation of DU constructor.

iterator

The iterator body.

source

Option source restriction: AppSettings or CommandLine.


Parameter Types:
  • expr : Expr<('Field -> 'Template)>
  • iterator : 'Field -> unit
  • ?source : ParseSource
this.IterResults(expr, iterator, ?source)
Full Usage:
this.IterResults(expr, iterator, ?source) Parameter Types:
  • expr : Expr<('Field -> 'Template)>
  • iterator : 'Field -> unit
  • ?source : ParseSource

Signature: (expr: Expr<('Field -> 'Template)> * iterator: ('Field -> unit) * source: ParseSource) -> unit

Iterates through *all* parse results for a given argument kind. Command line parameters have precedence over AppSettings parameters. Results are passed to an iterator function that is error handled by the parser.

Parameters

expr

The name of the parameter, expressed as quotation of DU constructor.

iterator

The iterator body.

source

Option source restriction: AppSettings or CommandLine.


Parameter Types:
  • expr : Expr<('Field -> 'Template)>
  • iterator : 'Field -> unit
  • ?source : ParseSource
this.PostProcessResult(expr, parser, ?source)
Full Usage:
this.PostProcessResult(expr, parser, ?source) Parameter Types:
  • expr : Expr<('Field -> 'Template)>
  • parser : 'Field -> 'R
  • ?source : ParseSource

Return Type: 'R
Signature: (expr: Expr<('Field -> 'Template)> * parser: ('Field -> 'R) * source: ParseSource) -> 'R

Returns the *last* specified parameter of given type. Command line parameters have precedence over AppSettings parameters. Results are passed to a post-processing function that is error handled by the parser.

Parameters

expr

The name of the parameter, expressed as quotation of DU constructor.

parser

The post-processing parser.

source

Optional source restriction: AppSettings or CommandLine.


Parameter Types:
  • expr : Expr<('Field -> 'Template)>
  • parser : 'Field -> 'R
  • ?source : ParseSource
Return Type: 'R
this.PostProcessResults(expr, parser, ?source)
Full Usage:
this.PostProcessResults(expr, parser, ?source) Parameter Types:
  • expr : Expr<('Field -> 'Template)>
  • parser : 'Field -> 'R
  • ?source : ParseSource

Return Type: 'R list
Signature: (expr: Expr<('Field -> 'Template)> * parser: ('Field -> 'R) * source: ParseSource) -> 'R list

Query parse results for given argument kind. Command line parameters have precedence over AppSettings parameters. Results are passed to a post-processing function that is error handled by the parser.

Parameters

expr

The name of the parameter, expressed as quotation of DU constructor.

parser

The post-processing parser.

source

Optional source restriction: AppSettings or CommandLine.


Parameter Types:
  • expr : Expr<('Field -> 'Template)>
  • parser : 'Field -> 'R
  • ?source : ParseSource
Return Type: 'R list
this.Raise(error, ?errorCode, ?showUsage)
Full Usage:
this.Raise(error, ?errorCode, ?showUsage) Parameter Types:
  • error : exn
  • ?errorCode : ErrorCode
  • ?showUsage : bool

Return Type: 'T
Signature: (error: exn * errorCode: ErrorCode * showUsage: bool) -> 'T

Raise an error through the argument parser's exiter mechanism. Display usage optionally.

Parameters

error

The error to be displayed.

errorCode

The error code to be returned.

showUsage

Print usage together with error message.


Parameter Types:
  • error : exn
  • ?errorCode : ErrorCode
  • ?showUsage : bool
Return Type: 'T
this.Raise(msg, ?errorCode, ?showUsage)
Full Usage:
this.Raise(msg, ?errorCode, ?showUsage) Parameter Types:
  • msg : string
  • ?errorCode : ErrorCode
  • ?showUsage : bool

Return Type: 'T
Signature: (msg: string * errorCode: ErrorCode * showUsage: bool) -> 'T

Raise an error through the argument parser's exiter mechanism. Display usage optionally.

Parameters

msg

The error message to be displayed.

errorCode

The error code to be returned.

showUsage

Print usage together with error message.


Parameter Types:
  • msg : string
  • ?errorCode : ErrorCode
  • ?showUsage : bool
Return Type: 'T
this.TryGetResult(expr, ?source)
Full Usage:
this.TryGetResult(expr, ?source) Parameter Types:
  • expr : Expr<('Fields -> 'Template)>
  • ?source : ParseSource

Return Type: 'Fields option
Signature: (expr: Expr<('Fields -> 'Template)> * source: ParseSource) -> 'Fields option

Returns the *last* specified parameter of given type, if it exists. Command line parameters have precedence over AppSettings parameters.

Parameters

expr

The name of the parameter, expressed as quotation of DU constructor.

source

Optional source restriction: AppSettings or CommandLine.


Parameter Types:
  • expr : Expr<('Fields -> 'Template)>
  • ?source : ParseSource
Return Type: 'Fields option
this.TryGetResult(expr, ?source)
Full Usage:
this.TryGetResult(expr, ?source) Parameter Types:
  • expr : Expr<'Template>
  • ?source : ParseSource

Return Type: 'Template option
Signature: (expr: Expr<'Template> * source: ParseSource) -> 'Template option

Returns the *last* specified parameter of given type, if it exists. Command line parameters have precedence over AppSettings parameters.

Parameters

expr

The name of the parameter, expressed as quotation of DU constructor.

source

Optional source restriction: AppSettings or CommandLine.


Parameter Types:
  • expr : Expr<'Template>
  • ?source : ParseSource
Return Type: 'Template option
this.TryGetSubCommand()
Full Usage:
this.TryGetSubCommand()
Return Type: 'Template option
Signature: unit -> 'Template option

Attempts to recover the subcommand parameter from the results, if one has been specified.


Return Type: 'Template option
this.TryPostProcessResult(expr, parser, ?source)
Full Usage:
this.TryPostProcessResult(expr, parser, ?source) Parameter Types:
  • expr : Expr<('Field -> 'Template)>
  • parser : 'Field -> 'R
  • ?source : ParseSource

Return Type: 'R option
Signature: (expr: Expr<('Field -> 'Template)> * parser: ('Field -> 'R) * source: ParseSource) -> 'R option

Returns the *last* specified parameter of given type. Command line parameters have precedence over AppSettings parameters. Results are passed to a post-processing function that is error handled by the parser.

Parameters

expr

The name of the parameter, expressed as quotation of DU constructor.

parser

The post-processing parser.

source

Optional source restriction: AppSettings or CommandLine.


Parameter Types:
  • expr : Expr<('Field -> 'Template)>
  • parser : 'Field -> 'R
  • ?source : ParseSource
Return Type: 'R option
this.UnrecognizedCliParams
Full Usage:
this.UnrecognizedCliParams
Return Type: string list
Signature: string list

Gets all unrecognized CLI parameters which accumulates if parsed with 'ignoreUnrecognized = true'


Return Type: string list
this.UnrecognizedCliParseResults
Full Usage:
this.UnrecognizedCliParseResults
Return Type: obj list
Signature: obj list

Gets all parse results that are not part of the current parsing context This is only applicable to subcommand parsing operations


Return Type: obj list
Fork me on GitHub