Commit Graph

13 Commits (devtest)

Author SHA1 Message Date
Lennart Spitzner 91d57b07c4 Clean up haddocks 2022-12-14 15:02:47 +01:00
Lennart Spitzner 5d67167c87 Major changeset: Add applicative, Refactor monadic interface
- monadic interface now uses two-phase setup: First step is to create a
  full CommandDesc value, second is running the parser on input while the
  CommandDesc is chained along
- applicative interface has a somewhat nicer/cleaner implementation, is
  more secure by avoiding any demands on the API user that are not encoded
  in types, but is slightly less expressive and requires ApplicativeDo to
  get readable code.
- The applicative interface is *NOT* finished and the test-suite does not
  cover it.
- Add the `traverseBarbie` construct which introduces a dependency on
  the `barbies` library. This also effectively:
- Stop support for ghc < 8.4.
- Refactor the module structure a bit, and change the API of the central
  `runCmdParser` function. It now returns a `PartialParseInfo`. Essentially,
  `runCmdParser` is a combination of the previous `runCmdParser` and the
  previous `simpleCompletion`. This API design is a curious advantage to
  laziness: Returning a complex struct is harmless as fields that the user
  does not use won't be evaluated. The downside is that the core function now
  looks like a complex beast, but the upside is that there is no need to
  expose multiple functions that are supposed to be chained in a certain way
  to get all functionality (if desired), and we still _can_ provide simpler
  versions that are just projections on the `PartialParseInfo`.
- Stop support for an anti-feature: The implicit merging of multiple
  sub-commands definitions with the same name.
2022-12-14 15:02:47 +01:00
Lennart Spitzner d4b3555b77 Add more tests for params with/without defaults 2020-04-10 23:29:24 +02:00
Lennart Spitzner 131216d4f4 Fix bug in simpleCompletion 2018-10-03 22:06:17 +02:00
Lennart Spitzner 10291d3808 Add testcases for completions 2018-02-12 15:47:53 +01:00
Lennart Spitzner dda70a959b Remove dependency on `either` package 2017-12-10 23:23:59 +01:00
Lennart Spitzner b2a25f3a07 Rename param functions, Add `addParamNoFlagString*`, Fix flag behaviour 2017-10-03 17:06:15 +02:00
Lennart Spitzner 95886b898b Add `addNullCmd` and `addStringParams` 2017-10-02 22:45:43 +02:00
Lennart Spitzner 12b886ad31 Allow --flag=value syntax in addition to --flag value 2017-05-16 21:02:01 +02:00
Lennart Spitzner c1cbc77e5b Implement mapOut, peekInput, cmd child merging 2017-05-16 12:22:28 +02:00
Lennart Spitzner b15f1ae585 Refactor module structure; Add haddock; Update README 2017-01-01 14:46:53 +01:00
Lennart Spitzner 66e2737e87 Fix test import (oops) 2016-10-11 00:24:31 +02:00
Lennart Spitzner f033c9e0ab Rename to butcher, Change everything else 2016-07-30 16:25:28 +02:00