Skip to content

Commit

Permalink
feat(ArgumentParser): Expose ProgramName
Browse files Browse the repository at this point in the history
  • Loading branch information
bartelink committed Feb 18, 2024
1 parent dc7dcd3 commit 6cc6393
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/Argu/ArgumentParser.fs
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,9 @@ and [<Sealed; NoEquality; NoComparison; AutoSerializable(false)>]
| _ -> argInfoWithCheck.Value
new ArgumentParser<'Template>(argInfo, programName, helpTextMessage, usageStringCharacterWidth, errorHandler)

/// <summary>The Program Name, as used when rendering help messages. Can be overridden via the <c>programName</c> constructor argument.</summary>
member val ProgramName = _programName

/// <summary>Force a check of the discriminated union structure.</summary>
static member CheckStructure() =
argInfoWithCheck.Value |> ignore
Expand Down Expand Up @@ -284,4 +287,4 @@ module ArgumentParserUtils =

/// gets the F# union tag representation of given argument instance
let tagOf (input : 'Template) : int =
ArgumentParser.Create<'Template>().GetTag input
ArgumentParser.Create<'Template>().GetTag input

0 comments on commit 6cc6393

Please sign in to comment.