Commit Graph

22 Commits

Author SHA1 Message Date
Oleg Grenrus
ad70813194 Regenerate .travis.yml
Temporarily disable 7.0 and 7.2 jobs, as there aren't
ansi-wl-pprint-0.6.8 with 7.0/7.2 support
https://matrix.hackage.haskell.org/#/package/ansi-wl-pprint

I'll add it back, as soon as
https://github.com/feuerbach/ansi-terminal/pull/82
is decided upon
2019-05-11 00:10:23 +03:00
Huw Campbell
0b83cf1099 Use tree to filter out optionals, instead of annotating the leaves 2019-03-15 20:22:09 +11:00
Huw Campbell
68bae8de5c Push bracket and parenthesis logic into the tree
Gives better rendering for optional alternatives
2019-03-15 20:22:03 +11:00
Ben Selfridge
0f2c15ac7e Add new test cases for optional pair of arguments 2019-03-15 20:10:54 +11:00
Huw Campbell
48f4d7a743 Put inline behind an option to keep old behaviour by default 2018-09-19 19:00:07 +10:00
Huw Campbell
7b2175bfc6 Fix suggestions test 2018-06-05 14:07:25 +10:00
Huw Campbell
7facbcecd1 Add a test for bash completion after -- 2017-05-12 14:25:45 +10:00
Huw Campbell
c24d176af2 Add test for rich completions 2017-05-12 14:07:22 +10:00
Huw Campbell
0ecaeb9038 Add test to ensure completions are reachable deeper into the parse 2017-03-29 19:03:42 +11:00
Huw Campbell
5cbd039ff6 Add type sig in test 2017-03-27 16:00:42 +11:00
Huw Campbell
ddcd183dbc Rewrite str, eitherReader and maybeReader to be polymorphic over IsString.
This has significant benefits, in that it covers off Text and ByteString
readers for free (and without dependencies) and works pretty seamlessly
with Attoparsec parsers.

May cause breakages if people are using str for type inference.
In that case, adding type signatures should fix the problem.
2017-03-27 15:33:26 +11:00
Huw Campbell
9c72eb9853 Add an error message for when the user does not supply an argument to an option
We can push the option name supplied into the construction of the
error message. This cleans up the `ExpectsArgError` type, while
keeping essentially all English text in one place, and allows
a user to customise this message better.

We can keep the builder API the same though using const.
2017-03-27 13:24:14 +11:00
Huw Campbell
d9df779685 Additional completions test 2017-03-08 19:30:56 +11:00
Huw Campbell
f66ff9b083 Put suggestions into their own ParserHelp record.
This would allow one to either delete them or not
show things like usage if there is a suggestion.
2017-03-08 19:30:56 +11:00
Huw Campbell
7f292eba34 Add a test for suggestions 2017-03-08 19:30:56 +11:00
Huw Campbell
5c48137480 Add suggestions for typos
Uses a Levenshtein distance to see if there's a suitable
candidate for suggestions.

Also fixes a subtle bug in bash completions, where argument
completers from deeper into the parser would have their
possibilities added to the completion.
2017-03-08 19:30:56 +11:00
Huw Campbell
a675abe418 Fix noIntersperse behaviour, and add new policies.
noInterpserse was not allowing any options to occur
before arguments, and wasn't behaving as its namesake
in other parsing libraries.

Add a new policy (which is potentially useful for
applications wrapping other cli tools) allowing the
command (or subcommand) to collect all unknown options
and arguments as positionals to be passed to the
command line.
2017-02-24 19:36:29 +11:00
Huw Campbell
739bf9ec9f Prepare for 0.13 release 2016-08-12 09:55:58 +10:00
Huw Campbell
36df57d9ae Fix warnings for GHC 8.
We're actually turning off redundant-constraints warnings, as we
use these so the user don't turn on metavars or use hasValue when
it doesn't make sense to do so.
2016-08-09 10:51:10 +10:00
Huw Campbell
021df337ed Stop exporting either (<>) function. 2016-08-08 18:19:11 +10:00
Ben Gamari
b29587c436 Split up Monoid instances into Semigroup and Monoid 2016-08-05 12:16:13 +10:00
Huw Campbell
ceac32cbac Remove tasty
Add GHC 8 tests to travis
2016-08-05 11:54:14 +10:00