Commit Graph

21 Commits

Author SHA1 Message Date
Nate Parsons f00d33b57c Use reflect-compatible struct tags in examples 2021-11-23 15:19:08 +11:00
Alec Thomas 60222fe397 Add README + go modules to server example. 2020-01-24 20:02:10 +11:00
Alec Thomas 2ac3d43124 Make invalid value error messages more useful. 2019-04-01 10:07:10 +11:00
Alec Thomas 862837e6fa Add ConfigFlag for loading configuration through a flag. 2018-09-11 10:02:23 +10:00
Alec Thomas 539214f23e Add contextual information to mapper errors. 2018-07-26 17:45:12 +10:00
Alec Thomas 99ff32a85f Bind Vars. 2018-07-06 10:44:09 +10:00
Alec Thomas 6408010083 Clean up disparity between Context and Kong.
Previously, there was a confusing mix of functionality shared between
the two wherein you would need to use the Kong type for printing errors,
etc. but it did not have access to the context in order to print
context-sensitive usage information. This has been fixed.

Additionally, there are now fuzzy correction suggestions for flags and
commands

Also added a server example which shows how Kong can be used for parsing
in interactive shells. Run with:

    $ go run ./_examples/server/*.go

Then interact with:

    $ ssh -p 6740 127.0.0.1
2018-06-27 09:11:11 +10:00
Alec Thomas 7e022e20b0 Fix example. 2018-06-21 23:22:29 +10:00
Alec Thomas a2ec050947 Implement a robust Context.Run().
This helps when composing large applications from separate command
structs.
2018-06-21 21:50:30 +10:00
Alec Thomas 212ea2a356 Add path, existingfile and existingdir types.
- Document custom types.
- Add docker example.
2018-06-21 16:19:08 +10:00
Alec Thomas cdcdf49f67 Display usage information on error. 2018-06-21 10:08:01 +10:00
Alec Thomas d9c0dd25b1 Compact help should display full command. 2018-06-21 00:04:35 +10:00
Alec Thomas 36506509f1 Better error reporting for short flags. 2018-06-20 22:45:34 +10:00
Alec Thomas 4edc701d63 Correctly check for required positionals. 2018-06-20 22:36:33 +10:00
Alec Thomas 653531d6bc Start making help slightly configurable. 2018-06-20 21:55:39 +10:00
Alec Thomas 73064a687f Add <command> to help when a sub-command is required. 2018-06-08 15:20:58 +10:00
Alec Thomas 96fa9c43d5 Improved documentation and help. 2018-06-05 11:36:51 +10:00
Alec Thomas fdc7230e22 Separate validation into a distinct step.
This allows help to be called even when the parse trace is invalid.
Without this, the command-line would have to be valid in order to use
help at all, which defeats the purpose.
2018-05-31 15:20:45 +10:00
Alec Thomas cf89213e1e Add hook support. 2018-05-27 18:01:10 +10:00
Gerald Kaszuba 3eb5e285ed Use "kong" as tag keys fixes #9 (#10) 2018-05-21 09:25:19 -04:00
Alec Thomas aa1bf9dcb5 Initial commit. 2018-04-10 16:51:06 +10:00