Commit Graph

241 Commits

Author SHA1 Message Date
Paolo Capriotti
23cadd1820 Add completion for commands. 2012-08-01 21:00:06 +01:00
Paolo Capriotti
573162700c Fix Context for nested commands. 2012-08-01 20:27:51 +01:00
Paolo Capriotti
5620a636c6 Add --bash-completion-script option. 2012-08-01 20:26:34 +01:00
Paolo Capriotti
ff7f37c518 Fix completion for options. 2012-08-01 19:56:19 +01:00
Paolo Capriotti
91eb2c579d Remove state monad from the P stack. 2012-08-01 18:31:19 +01:00
Paolo Capriotti
ce8a976bbc Refactor completion monad. 2012-08-01 18:14:03 +01:00
Paolo Capriotti
7a1c48faff Print failure message on stdout when exit code is 0. 2012-08-01 00:20:08 +01:00
Paolo Capriotti
b0b2efc0a1 Factor out bashCompletionQuery. 2012-07-31 23:58:53 +01:00
Paolo Capriotti
450b5a2d8e Basic completion functionality. 2012-07-31 23:55:30 +01:00
Paolo Capriotti
6a5ad58a86 Generalize parsing function to MonadP. 2012-07-31 23:05:44 +01:00
Paolo Capriotti
629bbf26cb Move P monad to an Internal module. 2012-07-31 22:29:17 +01:00
Paolo Capriotti
90e5591da9 Initial setup for bash completion. 2012-07-31 22:19:35 +01:00
Paolo Capriotti
db998cfac7 Refactoring: add StateT on the P monad stack. 2012-07-31 22:16:45 +01:00
Paolo Capriotti
f5585f6fe0 Prepare release 0.3.2. 2012-07-31 17:41:13 +01:00
Paolo Capriotti
1f724d6d47 Fix backwards compatibility with 0.3.1. 2012-07-31 17:41:12 +01:00
Paolo Capriotti
e2bb7643e9 Bump version to 0.3.2. 2012-07-31 17:41:09 +01:00
Paolo Capriotti
fd6331a001 Merge Alt improvements. 2012-07-31 17:40:17 +01:00
Paolo Capriotti
551562a4bf Show alternatives in the brief help text. 2012-07-31 17:32:27 +01:00
Paolo Capriotti
9fa5d8a42a Check that only one branch of an Alt is taken. 2012-07-31 14:05:53 +01:00
Paolo Capriotti
ba7c2fc5cc Keep only one branch of an Alt after a match.
A parser of the form `p1 <|> p2` should not match `p2` after `p1` is
successful, and vice-versa.
2012-07-31 14:01:11 +01:00
Paolo Capriotti
6ab4fc602b Bump version to 0.4.0. 2012-07-30 21:47:21 +01:00
Paolo Capriotti
8f7513a870 Prepare release 0.3.1. 2012-07-30 21:39:24 +01:00
Paolo Capriotti
430615091c Merge fix for #12. 2012-07-30 21:19:25 +01:00
Paolo Capriotti
e57ac66086 Update CHANGELOG. 2012-07-30 21:19:18 +01:00
Paolo Capriotti
50ff2911a7 Add modifiers to show default value.
Add new `showDefault` and `showDefaultWith` modifiers, which will result
in the default value (if present) to be displayed in the help text.

Fixes #12.
2012-07-30 21:17:13 +01:00
Paolo Capriotti
66bd310b84 Bump version to 0.3.1. 2012-07-30 20:00:19 +01:00
Paolo Capriotti
86cfa1b3a4 Merge remote-tracking branch 'dag/patch-1' 2012-07-30 19:59:21 +01:00
Dag Odenhall
827281cdd2 Export ArgumentFields 2012-07-30 21:49:23 +03:00
Paolo Capriotti
290c42491a Bump version to 0.3.0.1. 2012-07-30 19:37:15 +01:00
Paolo Capriotti
227ad3010f Add homepage and bug-tracker URLs. 2012-07-30 19:37:00 +01:00
Paolo Capriotti
e45332c121 Prepare release 0.3.0. 2012-07-30 19:31:22 +01:00
Paolo Capriotti
579441694a Update CHANGELOG. 2012-07-30 19:14:38 +01:00
Paolo Capriotti
243046fb34 Drop dependency on data-lens. 2012-07-30 19:13:16 +01:00
Paolo Capriotti
091508459e Replace "Common" with "Available" in help text.
"Common options" was intended as "all except internal", but it could be
interpreted as "global options" for a parser with commands.

Remove the possible confusion by using "Available options" instead,
which is also consistent with the label used for commands.
2012-07-30 19:13:13 +01:00
Paolo Capriotti
185a7d4af9 Revisit "commands" section in the tutorial.
Fix `subparser` example, and add alternative style with parsers
returning `IO` actions.
2012-07-30 18:46:01 +01:00
Paolo Capriotti
96e1d42cdd Fix typos in README. 2012-07-30 18:35:42 +01:00
Paolo Capriotti
6039788dc1 Remove dependency on data-default. 2012-07-30 15:20:10 +01:00
Paolo Capriotti
4f4490739b Restore documentation for idm and (&). 2012-07-23 21:47:27 +01:00
Paolo Capriotti
cf745f9a52 Change how defaults are handled in arguments.
The continuation parsers should have an empty list as default.

This should fix #14 for real.
2012-07-23 01:12:51 +01:00
Paolo Capriotti
165624b14b Update CHANGELOG. 2012-07-23 01:03:16 +01:00
Paolo Capriotti
91060d75bc Bump version to 0.3.0. 2012-07-23 01:01:41 +01:00
Paolo Capriotti
53e780f819 Update builder documentation. 2012-07-23 00:58:49 +01:00
Paolo Capriotti
c85171ac7e Remove propDefault field and simplify builders.
A significant simplification of the `Option` type. Since the
introduction of the `Alternative` instance, there is no need for an
explicit default value anymore.

Also, builders can be simplified to work on a single type, as there's
rarely a need for polymorphic updates. As a consequence, the `transform`
builder has been removed.

To make an option with a default value of `Nothing`, now we can do:

    optional :: Parser a -> Parser (Maybe a)
    optional p = (Just <$> p) <|> pure Nothing

which is more general (it works on parsers, not just options), less
ad-hoc, and probably easier to understand and reason about.

The modifier parameter for `arguments` has now been changed to operate
on the final parser, instead of the underlying parser (fixes #14).
2012-07-23 00:58:38 +01:00
Paolo Capriotti
e6532a407c Prepare release 0.2.0. 2012-07-22 23:28:34 +01:00
Paolo Capriotti
c1e65b6863 Update CHANGELOG. 2012-07-22 23:27:21 +01:00
Paolo Capriotti
111f86df11 Show multiSuffix for many-valued options.
Fixes #5.
2012-07-22 20:24:44 +01:00
Paolo Capriotti
0ff4f790ab Add ParserPrefs. 2012-07-22 20:13:01 +01:00
Paolo Capriotti
a4c60b10b1 Fix help text for non-mandatory options.
Options that were not mandatory because part of an AltP expression were
not correctly rendered.

Fixed by using the OptHelpInfo argument in mapParser.
2012-07-22 19:49:45 +01:00
Paolo Capriotti
817b9abca0 Add OptHelpInfo argument to mapParser. 2012-07-22 19:47:28 +01:00
Paolo Capriotti
f0fa92101a Make the ddash argument invisible.
The ddash argument in the definition of `arguments` is only an internal
parser, and should not appear in the help text.
2012-07-22 18:30:01 +01:00