diff options
author | defanor <defanor@uberspace.net> | 2017-12-04 19:14:06 +0300 |
---|---|---|
committer | defanor <defanor@uberspace.net> | 2017-12-04 19:14:06 +0300 |
commit | 88d9c4a76e27ddee2170bb21e90e0f0fcf77b44c (patch) | |
tree | 9d961f8fc78132d652edfc0c037cfb2ec0d74bda /README.md | |
parent | 0da83fbee2a242d78fa835b011c09839ac2eacda (diff) |
Introduce the omitNamedOptions option
It is nice to omit them, but may lead to ambiguity -- so better to
provide a safer option.
Diffstat (limited to 'README.md')
-rw-r--r-- | README.md | 15 |
1 files changed, 9 insertions, 6 deletions
@@ -14,9 +14,10 @@ e.g. [optparse-generic](https://hackage.haskell.org/package/optparse-generic), but the aim here is to handle more or less arbitrary types. -Warning: it is currently possible to run into ambiguity by defining a -recursive structure with optional named elements. Unit type can be -used to avoid that, see the `RecursiveRecordMaybe` test. +Warning: it is possible to run into ambiguity by defining a recursive +structure with optional named elements while using default options. +Unit type can be used to avoid that, or `omitNamedOptions` can be +disabled. Not production-ready yet, merely a prototype. @@ -32,7 +33,7 @@ Input { something = Nothing , fooBar2 = Bar} ``` -With the default modifiers, its serialized version should look like +With the default options, its serialized version should look like this: ```haskell @@ -45,9 +46,11 @@ What would look like this in a shell: --foobar foo 1 'a string' bar ``` -A more verbose version can be produced and parsed with -`alwaysUseSelName = True`: +More verbose versions can be produced and parsed with +`alwaysUseSelName = True` and/or `omitNamedOptions = False`: ```sh --foobar foo --arg1 1 --arg2 'a string' --foobar2 bar +nothing just foo 1 'a string' bar +--something nothing --foobar just foo --arg1 1 --arg2 'a string' --foobar2 bar ``` |