Skip to content

Breaking changes for v6.0.0 #68

Closed
Closed
@jpdillingham

Description

@jpdillingham

The existing Parse() has been replaced with three overloads.

Old:

public static Arguments Parse(string commandLineString = default(string), Type type = null, [CallerMemberName] string caller = default(string)) {}

New:

public static Arguments Parse(Action<ArgumentParseOptions> configure = null) {}
public static Arguments Parse(string commandLineString, Action<ArgumentParseOptions> configure = null) {}
public static Arguments Parse(string commandLineString, ArgumentParseOptions options) {}

The caller argument wasn't doing anything in the first place, and the type argument is now specified through the TargetType property of ArgumentParseOptions.

ArgumentParseOptions contains the following properties:

  • TargetType -- same functionality as the previous type parameter
  • CombineAllMultiples -- combines repeated argument values into a list
  • CombinableArguments -- if CombineAllMultiples is false, combines the specified arguments into a list
    If TargetType is supplied and repeated arguments match a property in the type, the behavior remains the same; if the backing type of the property is a collection, values are combined, otherwise they are overwritten.

If TargetType is not supplied, or repeated arguments don't match a property in the type, the behavior depends on the other options for multiples, either everything or just those specified.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions