Commit Graph

185 Commits

Author SHA1 Message Date
Paolo Capriotti
240e42e9c8 Split Builder module.
Created a `Builder.Internal` module for internal definitions used by the
builders, and a `Builder.Arguments` module for all the builders dealing
with arguments.
2012-09-23 13:56:19 +01:00
Paolo Capriotti
62c313873f Update CHANGELOG. 2012-09-04 17:40:07 +01:00
Paolo Capriotti
ff418d8564 Bump version to 0.4.1. 2012-09-04 17:28:43 +01:00
Paolo Capriotti
bb2c0603b7 Give precedence to custom reader in option builder (#19). 2012-09-04 17:25:25 +01:00
Paolo Capriotti
2881d647f2 Update travis configuration.
Manual installation of test packages is not needed anymore.
2012-08-06 21:27:30 +01:00
Paolo Capriotti
c7a0ef09c7 Merge pull request #18 from dag/patch-2
Export HasCompleter
2012-08-05 08:40:39 -07:00
Dag Odenhall
9b1b068700 Export HasCompleter 2012-08-05 18:31:20 +03:00
Paolo Capriotti
1a068c316b Prepare release 0.4.0. 2012-08-05 13:46:34 +01:00
Paolo Capriotti
e7043c2585 Update CHANGELOG. 2012-08-05 13:46:15 +01:00
Paolo Capriotti
4179ffcd43 Fix rendering of brief help text with internal options.
Discard internal options before option tree simplification, so Alt nodes
with only 1 non-internal child get simplified correctly.

This fixes an issue where an `arguments` parser was displayed as

    ([ARGS...])

in the brief help text.
2012-08-05 13:43:03 +01:00
Paolo Capriotti
a907cc580f Formatting changes. 2012-08-05 13:30:45 +01:00
Paolo Capriotti
4a7661a597 Add briefDesc modifier for info.
Since `infoFullDesc` is True by default, we need a modifier to change it
to False.
2012-08-05 13:29:32 +01:00
Paolo Capriotti
7f66f5d464 Fix completion for successful parses. 2012-08-05 13:22:13 +01:00
Paolo Capriotti
1b22a5321b Fix order of commands in help text.
They are stored in reverse order, so reverse before displaying them.
2012-08-05 02:57:46 +01:00
Paolo Capriotti
ba788992c6 Update CHANGELOG. 2012-08-05 02:54:29 +01:00
Paolo Capriotti
b110838cdb Merge disambiguation feature (#8). 2012-08-05 02:39:13 +01:00
Paolo Capriotti
4982c6fa44 Export customExecParser. 2012-08-05 02:32:01 +01:00
Paolo Capriotti
c4cb87f1e1 Add tests and make them pass. 2012-08-05 02:30:48 +01:00
Paolo Capriotti
0a2eedb50c Add modifier for disambiguate option. 2012-08-05 02:10:09 +01:00
Paolo Capriotti
4f3108ad14 Implement option name disambiguation. 2012-08-05 02:01:25 +01:00
Paolo Capriotti
e4db2e9da6 Add disambiguation option. 2012-08-05 00:15:23 +01:00
Paolo Capriotti
3d739240c4 Add a Reader ParserPrefs to the monad stacks. 2012-08-04 23:41:40 +01:00
Paolo Capriotti
8757e9db18 Remove StateT from Completion monad stack. 2012-08-02 23:30:27 +01:00
Paolo Capriotti
25d4c1075e Remove associated type PError from MonadP. 2012-08-02 23:26:55 +01:00
Paolo Capriotti
863a926907 Fix show_default test. 2012-08-02 22:25:30 +01:00
Paolo Capriotti
82f8fe30c0 Help option should have no metavar. 2012-08-02 22:24:16 +01:00
Paolo Capriotti
8108215b61 Merge bash-completion feature (#10). 2012-08-02 22:22:57 +01:00
Paolo Capriotti
98b11198fc Remove file and directory completers.
Their functionality is covered by `bashCompleter`, for which there is
now a modifier `action`.
2012-08-02 22:13:58 +01:00
Paolo Capriotti
a3081f1a30 Recover from compgen failures. 2012-08-02 20:25:18 +01:00
Paolo Capriotti
1820597c6b Add -o filenames option to completion script. 2012-08-02 20:20:15 +01:00
Paolo Capriotti
814e63fac3 Add bash completer. 2012-08-02 20:19:14 +01:00
Paolo Capriotti
13e4c99e8f Implement completion with completers. 2012-08-02 20:16:58 +01:00
Paolo Capriotti
ee208d3488 Add more completers. 2012-08-02 20:16:53 +01:00
Paolo Capriotti
658b4407e8 Add completer to regular options. 2012-08-02 17:56:35 +01:00
Paolo Capriotti
62f6b14474 Always try completion parser first. 2012-08-02 17:44:25 +01:00
Paolo Capriotti
632ef41334 Add argReader and completer argument modifiers. 2012-08-02 17:44:01 +01:00
Paolo Capriotti
4a56b752f4 Set default metavar for regular options. 2012-08-02 17:29:18 +01:00
Paolo Capriotti
b91d2f6b8f Run argument completer during bash completion. 2012-08-02 17:24:49 +01:00
Paolo Capriotti
645ebc4d3c Make ParserFailure monadic. 2012-08-02 17:16:59 +01:00
Paolo Capriotti
106fe429c9 Add support for completers in ArgReader. 2012-08-02 16:57:29 +01:00
Paolo Capriotti
b8841a5abc Add regression test for #16. 2012-08-02 00:49:19 +01:00
Paolo Capriotti
97f70ea98b Bump version to 0.3.3. 2012-08-02 00:42:49 +01:00
Paolo Capriotti
c02a363be3 Optimize bind for Parser with a Codensity monad.
Make the `Monad` instance for `Parser` explicit (on a `ParserM`
newtype), and wrap it in a Codensity monad transformer to remove the
quadratic complexity issue in the monadic bind.

Fixes #16.
2012-08-02 00:42:23 +01:00
Paolo Capriotti
972fe8b4a4 Refactor implementation of many and arguments.
Clean up recursion in the implementation of `many`, so that AltP is
inside BindP, instead of the other way around.
2012-08-02 00:41:24 +01:00
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