Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(ArgumentParser): Expose ProgramName #229

Merged
merged 2 commits into from
Feb 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions RELEASE_NOTES.md
Original file line number Diff line number Diff line change
@@ -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
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