feat(ParseConfig): Add record + Parse(config) overload (additive)#307
Open
dimension-zero wants to merge 3 commits into
Open
feat(ParseConfig): Add record + Parse(config) overload (additive)#307dimension-zero wants to merge 3 commits into
dimension-zero wants to merge 3 commits into
Conversation
* ArgumentParser.fs: Introduce public ParseConfig record carrying Inputs, ConfigurationReader, IgnoreMissing, IgnoreUnrecognized, RaiseOnUsage. Provide ParseConfig.Default reproducing the historical Parse(...) defaults. * New Parse(config: ParseConfig) overload delegates to the existing Parse(?inputs, ?configurationReader, ...) implementation. All current overloads remain untouched, so existing callers see no shape change. Useful when hosts want to layer configuration programmatically (e.g. merging container-provided defaults with user overrides) rather than juggling many optional method arguments.
6 new tests: * ParseConfig.Default holds the historical defaults (None inputs, None reader, false IgnoreMissing/IgnoreUnrecognized, true RaiseOnUsage). * Parse(config with explicit inputs) parses those inputs. * Parse(config) matches Parse(?inputs, ...) for the same shape. * IgnoreMissing=true skips the mandatory check on empty inputs. * IgnoreUnrecognized=true gathers unknown args into UnrecognizedCliParams. * ConfigurationReader provided via config sources AppSettings entries. A separate non-mandatory schema is used for the AppSettings test because Argu's missing-mandatory check fires from CLI parsing even when AppSettings provides a value (existing behaviour, not introduced by PR 19). Net suite size on this branch: 112 -> 118.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
feat(ParseConfig): Add record + Parse(config) overload (additive)
Inputs, ConfigurationReader, IgnoreMissing, IgnoreUnrecognized,
RaiseOnUsage. Provide ParseConfig.Default reproducing the historical
Parse(...) defaults.
Parse(?inputs, ?configurationReader, ...) implementation. All current
overloads remain untouched, so existing callers see no shape change.
Useful when hosts want to layer configuration programmatically (e.g.
merging container-provided defaults with user overrides) rather than
juggling many optional method arguments.
test(ParseConfig): Add coverage for ParseConfig record + Parse(config)
6 new tests:
reader, false IgnoreMissing/IgnoreUnrecognized, true RaiseOnUsage).
A separate non-mandatory schema is used for the AppSettings test because
Argu's missing-mandatory check fires from CLI parsing even when AppSettings
provides a value (existing behaviour, not introduced by PR 19).
Net suite size on this branch: 112 -> 118.