Skip to content

Commit

Permalink
feat(ArgumentParser): Expose ProgramName (fsprojects#229)
Browse files Browse the repository at this point in the history
  • Loading branch information
bartelink committed Feb 28, 2024
1 parent f4f3410 commit 333edd1
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
3 changes: 3 additions & 0 deletions RELEASE_NOTES.md
@@ -1,3 +1,6 @@
### 6.2.0
* Add `ParseResults.ProgramName` [#229](https://github.com/fsprojects/Argu/pull/229)

### 6.1.5
* Fix the regression of the [#127](https://github.com/fsprojects/Argu/pull/127) merged in 6.1.2 and fix Mandatory arguments in nested subcommands. [#220](https://github.com/fsprojects/Argu/issues/220) [@fpellet](https://github.com/fpellet)

Expand Down
5 changes: 4 additions & 1 deletion src/Argu/ArgumentParser.fs
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 333edd1

Please sign in to comment.