This has been bugging me for a looong time.
The fix is pragmatic. Refactoring the option system to allow for failure
when parsing the command line flags would have been more principled but
/much/ more difficult and invasive. It is a good thing that we can now
produce clean failures by throwing a dedicated exception type (in contrast
to calling error which will "crash" darcs with a "This is a bug, please
report it" message).
3 patches for repository http://darcs.net/screened:
patch 262290797f77f252eda1d409ef2be56ba939d51b
Author: Ben Franksen <ben.franksen@online.de>
Date: Mon Feb 10 20:56:29 CET 2020
* finally fix parsing of option arguments
This concerns --index=, --max-count, and --last. Parsing the argument as an
integer or a range of integers may fail, as well as limiting the value to a
range (counts should be >= 0, an index should be > 0). This was previously
either not handled or in an unreliable way via in-band values. Since back
when I re-designed the option system I failed to allow for failure, we now
throw a special exception type, so we'll get a clean failure with a message.
patch 9943041892a3525695e3f337a6bc5e99485814dd
Author: Ben Franksen <ben.franksen@online.de>
Date: Mon Feb 10 20:57:26 CET 2020
* fix some outdated TODO items in D.UI.Options.All
patch 7a959afdea9148d08dde6521d908e7b5f093f989
Author: Ben Franksen <ben.franksen@online.de>
Date: Mon Feb 10 21:16:32 CET 2020
* improve haddocks in D.UI.Options.Util
Attachments
|