Skip to content

v0.5.0

Compare
Choose a tag to compare
@andrey-zherikov andrey-zherikov released this 28 Nov 17:55
· 170 commits to master since this release
32801c2

Enhancements

  • NamedArgument UDA can be used without parentheses:

    @NamedArgument  string a;
    @(NamedArgument.Required()) int b;
  • TrailingArguments UDA can be used without parentheses:

    @TrailingArguments string[] args;
  • Argument names can be listed without putting them into an array:

    @NamedArgument("a","apple","appl") int apple;
  • New Placeholder property that can be used with NamedArgument and PositionalArgument UDAs to indicate the value of the argument in help message:

    @NamedArgument  string s;
    @(NamedArgument.Placeholder("VALUE"))  string p;

    This is how it looks on help page: -s S and -p VALUE

  • Added validation of the values for enum types. In case if the incorrect value is passed, this message will be printed:

    Error: Invalid value 'kiwi' for argument '--fruit'.
    Valid argument values are: apple,pear,banana
    
  • Added *NumberOfValues properties to specify number of values that an argument can receive (see readme for details):

    @(NamedArgument.NumberOfValues(1,3)) int[] a;
    @(NamedArgument.NumberOfValues(2))   int[] b;
  • Added AllowedValues property to specify the values that an argument can receive (see readme for details):

    @(NamedArgument.AllowedValues!(["apple","pear","banana"])) string fruit;

Breaking changes

  • HelpText is renamed to Description:

    @(NamedArgument.Description("some description"))  string a;
  • MetaValue (it was not documented) is renamed to Placeholder