Skip to content
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
1 change: 0 additions & 1 deletion RELEASE_NOTES.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
* Fix [misrendering of usage when parameter description blank](https://github.com/fsprojects/Argu/issues/173) [#323](https://github.com/fsprojects/Argu/pull/323) [@DominikL1999](https://github.com/DominikL1999)
* Add `Separator("=", orSpace = true)` and `Separator "="` attribute syntax to replace `Obsolete`d `EqualsAssignment`, `ColonAssignment`, `CustomAssignment`, `EqualsAssignmentOrSpaced`, `ColonAssignmentOrSpaced` and `CustomAssignmentOrSpaced` [#315](https://github.com/fsprojects/Argu/pull/315) [@dimension-zero](https://github.com/dimension-zero)
* Add `Argu.Samples.Introspect` sample [#298](https://github.com/fsprojects/Argu/pull/298) [@dimension-zero](https://github.com/dimension-zero)
* Add `ArgumentParser.Parse(ParseConfig)` [#307](https://github.com/fsprojects/Argu/pull/307) [@dimension-zero](https://github.com/dimension-zero)
* Add `ArgumentParser.PrintUsage(..., ?UsageStrings)` for localization support [#303](https://github.com/fsprojects/Argu/pull/303) [@dimension-zero](https://github.com/dimension-zero)
* Add AOT annotations [#314](https://github.com/fsprojects/Argu/pull/314) [@dimension-zero](https://github.com/dimension-zero)
Comment thread
bartelink marked this conversation as resolved.
* Add `SourceGenerator.ArguGenerate` marker [#318](https://github.com/fsprojects/Argu/pull/318) [@dimension-zero](https://github.com/dimension-zero)
Expand Down
42 changes: 0 additions & 42 deletions src/Argu/ArgumentParser.fs
Original file line number Diff line number Diff line change
Expand Up @@ -5,35 +5,6 @@ open System.Diagnostics.CodeAnalysis

open Argu.UnionArgInfo

Comment thread
bartelink marked this conversation as resolved.
/// Configuration record for <see cref="ArgumentParser`1.Parse(ParseConfig)"/>.
/// Each field carries the same meaning as the matching optional parameter on
/// the existing <c>Parse</c> overload. Use <see cref="ParseConfig.Default"/>
/// as a starting point and override only the fields you care about.
[<NoEquality; NoComparison>]
type ParseConfig =
{
/// The command line input. <c>None</c> takes the inputs from <c>System.Environment</c>.
Inputs : string [] option
/// Configuration reader used to source AppSettings-style arguments.
/// <c>None</c> uses the AppSettings configuration of the current process.
ConfigurationReader : IConfigurationReader option
/// Ignore errors caused by the Mandatory attribute.
IgnoreMissing : bool
/// Ignore CLI arguments that do not match the schema.
IgnoreUnrecognized : bool
/// Treat '--help' parameters as parse errors.
RaiseOnUsage : bool
}
/// Default parse configuration, matching the historical <c>Parse(...)</c> defaults:
/// inputs and configurationReader inherited from the environment, do not ignore
/// missing or unrecognized arguments, and raise on '--help'.
static member Default : ParseConfig =
{ Inputs = None
ConfigurationReader = None
IgnoreMissing = false
IgnoreUnrecognized = false
RaiseOnUsage = true }

module internal TrimMessages =
[<Literal>]
let aot =
Expand Down Expand Up @@ -201,19 +172,6 @@ and [<Sealed; NoEquality; NoComparison; AutoSerializable(false)>]

with ParserExn (errorCode, msg) -> errorHandler.Exit (msg, errorCode)

/// <summary>Parse both command line args and supplied configuration reader, using
/// a <see cref="ParseConfig"/> record. Useful when callers want to construct
/// the parameter set programmatically (e.g. layering host defaults over user
/// overrides) without juggling many optional method arguments.</summary>
/// <param name="config">The parse configuration. See <c>ParseConfig.Default</c>.</param>
member self.Parse (config : ParseConfig) : ParseResults<'Template> =
self.Parse(
?inputs = config.Inputs,
?configurationReader = config.ConfigurationReader,
ignoreMissing = config.IgnoreMissing,
ignoreUnrecognized = config.IgnoreUnrecognized,
raiseOnUsage = config.RaiseOnUsage)

/// <summary>Parse both command line args and supplied configuration reader.
/// Results are merged with command line args overriding configuration parameters.</summary>
/// <param name="inputs">The command line input. Taken from System.Environment if not specified.</param>
Expand Down
1 change: 0 additions & 1 deletion tests/Argu.Tests/Argu.Tests.fsproj
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
<Compile Include="Tests.fs"/>
<Compile Include="EnvVarTests.fs" />
<Compile Include="CoverageTests.fs"/>
<Compile Include="ParseConfigTests.fs"/>
<Compile Include="UsageStringsTests.fs"/>
<Compile Include="SeparatorAttributeTests.fs" />
</ItemGroup>
Expand Down
85 changes: 0 additions & 85 deletions tests/Argu.Tests/ParseConfigTests.fs

This file was deleted.

Loading