Skip to content

Commit 1081119

Browse files
Update readme
1 parent 87e1cda commit 1081119

File tree

1 file changed

+22
-5
lines changed

1 file changed

+22
-5
lines changed

README.md

Lines changed: 22 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,17 @@
1717

1818
### Breaking changes
1919

20-
* Custom error handler function (`Config.errorHandler`) now receives message text with ANSI styling if styling is enabled. One can use `argparse.ansi.getUnstyledText` function to remove any styling - this function returns a range of unstyled `string` objects which can be used as is or `join`'ed into a string if needed: `message.getUnstyledText.join`.
20+
* Changes in `Config`:
2121

22-
* `Config.namedArgChar` is renamed to `Config.namedArgPrefix`.
22+
* Custom error handler function (`Config.errorHandler`) now receives message text with ANSI styling if styling is enabled. One can use `argparse.ansi.getUnstyledText` function to remove any styling - this function returns a range of unstyled `string` objects which can be used as is or `join`'ed into a string if needed: `message.getUnstyledText.join`.
2323

24-
* `Config.endOfArgs` is renamed to `Config.endOfNamedArgs`.
24+
* `Config.namedArgChar` is renamed to `Config.namedArgPrefix`.
2525

26-
* `Config.helpStyle` is renamed to `Config.styling`.
26+
* `Config.endOfArgs` is renamed to `Config.endOfNamedArgs`.
2727

28-
* `Config.addHelp` is renamed to `Config.addHelpArgument`.
28+
* `Config.helpStyle` is renamed to `Config.styling`.
29+
30+
* `Config.addHelp` is renamed to `Config.addHelpArgument`.
2931

3032
* `Style.namedArgumentName` is renamed to `Style.argumentName`.
3133

@@ -57,6 +59,21 @@
5759

5860
* `@TrailingArguments` UDA is removed: all command line parameters that appear after double-dash `--` are considered as positional arguments. So if those parameters are to be parsed, use `@PositionalArgument` instead of `@TrailingArguments`.
5961

62+
* Changes in parsing customization: all customizers (`PreValidation`, `Parse`, `Validation`, `Action`, `ActionNoValue`) now accept functions as runtime parameters instead of template arguments
63+
64+
For example, replace this
65+
```d
66+
.Parse !((string s) { return s[1]; })
67+
.Validation!((char v) { return v >= '0' && v <= '9'; })
68+
```
69+
with
70+
```d
71+
.Parse ((string s) { return cast(char) s[1]; })
72+
.Validation((char v) { return v >= '0' && v <= '9'; })
73+
```
74+
75+
76+
* Dropped support for DMD-2.099.
6077

6178
### Enhancements and bug fixes
6279

0 commit comments

Comments
 (0)