Commit Graph

  • d2286db01b Use more recent version of go. Alec Thomas 2019-11-13 08:27:12 +11:00
  • cd3f64f045 Support "yes", "1" and "true" for bool values. Alec Thomas 2019-11-13 08:16:32 +11:00
  • d15c8fca8d Bind parent nodes when executing Run(). Alec Thomas 2019-10-30 13:46:08 +11:00
  • 77a613fb8b Much more thorough checking of enum values. Alec Thomas 2019-10-11 16:55:10 +11:00
  • 9a1f499155 Support for default values ${var=default} in interpolation variables. Alec Thomas 2019-09-24 13:33:20 +10:00
  • f7d3d9bfb5 A note in the README linking to a JSON example. gak 2019-07-21 11:51:30 +10:00
  • f830198fcd XOR groups for flags. (#35) gak 2019-07-20 20:31:04 +10:00
  • 0548c6b1af Correctly hide sub-commands. Alec Thomas 2019-07-08 14:11:08 +10:00
  • 33b8d2b19c Quote enum values when displaying errors. Alec Thomas 2019-06-21 14:51:44 +10:00
  • 102a975844 Validate after everything is applied. Alec Thomas 2019-06-21 12:09:04 +10:00
  • 95de7d2f0d Produce a more useful error when flag-like values are used for flag values. Alec Thomas 2019-06-21 10:23:09 +10:00
  • 1076f5ee1f Remove unused return value from PopValueInto. Alec Thomas 2019-06-21 10:07:24 +10:00
  • 9d0bd59611 Print error after usage when UsageOnError is set. Alec Thomas 2019-06-21 09:53:05 +10:00
  • 8c83948cff Make most option functions return Option rather than OptionFunc. Alec Thomas 2019-06-21 09:51:30 +10:00
  • 7be398e79f ApplyDefaults() now only applies defaults if the value is not already otherwise set. Alec Thomas 2019-06-12 13:25:33 +10:00
  • 0d256bb68a Add a kong.ApplyDefaults() function. Alec Thomas 2019-06-06 15:22:25 +10:00
  • 439c674f7a Use interface{} instead of string in tokens. Alec Thomas 2019-04-24 23:18:57 +10:00
  • 2ac3d43124 Make invalid value error messages more useful. Alec Thomas 2019-04-01 10:06:02 +11:00
  • 4e9878074f Hide hidden sub-commands. Alec Thomas 2019-03-29 11:08:28 +11:00
  • 42ea64b1b4 Factor out command help into functions. Alec Thomas 2019-01-24 17:11:54 +11:00
  • 2a90ca2ad3 feat: add a command tree help view (#32) Matthias Fax 2019-01-21 14:14:26 +01:00
  • fcf5f9bc1a fix: hidden tag is not passed to the flag object Matthias Fax 2019-01-19 18:57:21 +01:00
  • a6ce719390 Call Run(...) for all parent nodes. Alec Thomas 2019-01-13 21:32:44 +11:00
  • 443709c0bb Allow multiple Vars{} to be passed. Alec Thomas 2019-01-12 21:48:24 +11:00
  • 9b2e9343a0 Fix circle. Alec Thomas 2019-01-12 21:20:54 +11:00
  • 886c2d7b01 Better help for maps. Alec Thomas 2019-01-12 20:59:24 +11:00
  • 59339303b6 Add license. Alec Thomas 2018-12-24 22:04:49 +11:00
  • c8b3fc9840 A few extra fixes and tests. Alec Thomas 2018-11-21 11:59:53 +11:00
  • aedca401da Hide sub-tree when parent is hidden. Alec Thomas 2018-11-14 10:01:45 +11:00
  • 010e3134ca Ensure flag defaults (or envars) aren't scanned in as untyped tokens. Alec Thomas 2018-11-06 14:40:02 +11:00
  • 072357f8ba Make ExpandPath public. Alec Thomas 2018-11-06 11:37:26 +11:00
  • e474873f84 Don't show ... in help for named slice types. Alec Thomas 2018-11-06 11:15:35 +11:00
  • 041e879d63 Expand ~ for FileContentFlag. Alec Thomas 2018-11-03 09:51:57 +11:00
  • fddfb973d6 Clean up error handling a bit. Alec Thomas 2018-11-03 09:49:00 +11:00
  • c0df056b14 Simplify FileContentFlag. Alec Thomas 2018-10-25 12:53:55 -07:00
  • 119a0d115b Ensure context bindings are used for Run(). Alec Thomas 2018-09-27 14:58:03 +10:00
  • f72f53d947 Support for adding bindings to the Context. Alec Thomas 2018-09-27 14:20:16 +10:00
  • 5d7703774f Validate enums (finally). Alec Thomas 2018-09-23 19:59:25 +10:00
  • d648254c7d Don't blindly SetString. Alec Thomas 2018-09-22 21:18:22 +10:00
  • 0f67a38060 Make FileContentFlag a struct to keep track of the path. Alec Thomas 2018-09-22 17:09:28 +10:00
  • 1048bd0448 Add a FileContentFlag that loads the contents of a file into a flag value. Alec Thomas 2018-09-22 11:13:20 +10:00
  • c935ea07dd Fix some more Resolver changes. Alec Thomas 2018-09-21 17:10:53 +10:00
  • c112a076e7 Convert resolvers to an interface with a Validate() method. Alec Thomas 2018-09-21 15:18:17 +10:00
  • 25399cde9e Fix erroneously "fixed" error message. Alec Thomas 2018-09-21 13:51:11 +10:00
  • 3a832f8343 Treat envars as higher priority than resolvers. Alec Thomas 2018-09-21 12:06:24 +10:00
  • 026359efd8 Call reset() in Trace(). Alec Thomas 2018-09-21 11:11:13 +10:00
  • 6406edf15f Add Visitor function for walking the model. Alec Thomas 2018-09-20 21:29:57 +10:00
  • 6fa83bdc0e Apply hooks to default values. Alec Thomas 2018-09-20 18:16:45 +10:00
  • 54338bd8b1 Add an "embed" tag. Alec Thomas 2018-09-19 13:23:18 +10:00
  • 0ba159f97d Document tag set. Alec Thomas 2018-09-19 13:00:35 +10:00
  • 2e29ff8981 Add support for setting variables via tag. Alec Thomas 2018-09-19 12:56:12 +10:00
  • 467352418f Ignore fields tagged with kong:"-". Alec Thomas 2018-09-17 10:25:35 +10:00
  • 9cbf4a5d4b Update TOC. Alec Thomas 2018-09-13 17:13:48 +10:00
  • 63a402d3b2 Add BindTo option for binding interface implementations. Alec Thomas 2018-09-13 14:47:46 +10:00
  • 37d57a878b Support for embedding interfaces. Alec Thomas 2018-09-12 13:18:52 +10:00
  • fd197e5081 Support for flag prefixing. Alec Thomas 2018-09-12 12:17:57 +10:00
  • 844494faff Allow bool flags to be set to true or false explicitly. Alec Thomas 2018-09-11 23:57:18 +10:00
  • 862837e6fa Add ConfigFlag for loading configuration through a flag. Alec Thomas 2018-09-11 09:56:57 +10:00
  • 3b6f48371a Add godoc link. Alec Thomas 2018-09-10 20:56:59 +10:00
  • ebe508cf46 Fix incorrect error missing for missing required args. Alec Thomas 2018-08-14 21:05:21 +10:00
  • f0bd1294a7 Support detailed help. Alec Thomas 2018-08-14 14:41:27 +10:00
  • 27d2a08e53 Use a dynamically sized left column in help. Alec Thomas 2018-08-09 20:35:47 +10:00
  • e2c55d143e Really don't suggest hidden commands. Alec Thomas 2018-08-08 14:45:26 +10:00
  • 6fcc190f78 Don't suggest hidden commands. Alec Thomas 2018-08-08 14:42:56 +10:00
  • 856d62e28a Support multiple key+value pairs for map flags. Alec Thomas 2018-07-26 20:35:20 +10:00
  • 539214f23e Add contextual information to mapper errors. Alec Thomas 2018-07-26 17:45:12 +10:00
  • 99ff32a85f Bind Vars. Alec Thomas 2018-07-06 10:44:09 +10:00
  • 17e855bc47 Fix option section in README. Alec Thomas 2018-07-05 10:10:03 +10:00
  • a13c5a0039 Add hook callback methods. Alec Thomas 2018-07-04 22:29:47 +10:00
  • 1f1e9d0f0f Convert Option to an interface and make Vars a map conforming to the interface. Alec Thomas 2018-07-03 22:56:22 +10:00
  • b2cab08684 Add support for a mapper interface directly on fields. Alec Thomas 2018-06-29 12:33:50 +10:00
  • 0bc26a865d Minor cleanup. Alec Thomas 2018-06-27 21:13:47 +10:00
  • 1bb0c0b4b2 Support limited variable interpolation. Alec Thomas 2018-06-27 21:07:06 +10:00
  • 6408010083 Clean up disparity between Context and Kong. Alec Thomas 2018-06-25 14:45:20 +10:00
  • f7acb2b389 Link to example code. Alec Thomas 2018-06-23 15:21:14 +10:00
  • e756d995c7 Improve README. Alec Thomas 2018-06-23 15:02:44 +10:00
  • 00847157a1 Ensure -- consumes all tokens, not just positional. Alec Thomas 2018-06-23 08:11:59 +10:00
  • 7e022e20b0 Fix example. Alec Thomas 2018-06-21 23:22:29 +10:00
  • a2ec050947 Implement a robust Context.Run(). Alec Thomas 2018-06-21 21:50:30 +10:00
  • e4f37b5d1a Support url.URL. Alec Thomas 2018-06-21 16:47:26 +10:00
  • 212ea2a356 Add path, existingfile and existingdir types. Alec Thomas 2018-06-21 16:16:27 +10:00
  • cdcdf49f67 Display usage information on error. Alec Thomas 2018-06-21 10:08:01 +10:00
  • d9c0dd25b1 Compact help should display full command. Alec Thomas 2018-06-21 00:04:35 +10:00
  • 39fd1507da Document HelpOptions. Alec Thomas 2018-06-20 23:47:26 +10:00
  • 36506509f1 Better error reporting for short flags. Alec Thomas 2018-06-20 22:45:34 +10:00
  • 4edc701d63 Correctly check for required positionals. Alec Thomas 2018-06-20 22:36:33 +10:00
  • 653531d6bc Start making help slightly configurable. Alec Thomas 2018-06-20 21:51:56 +10:00
  • 3a2f3eebdd Indent multi-line messages/errors. Alec Thomas 2018-06-20 12:44:18 +10:00
  • 9a68d32e72 Support for embedded structs + sep:"none". Alec Thomas 2018-06-14 11:27:10 +10:00
  • 51ca3e76a8 More docs. Alec Thomas 2018-06-13 23:10:30 +10:00
  • 662ace41c5 Move separator defaulting back into Tag. Alec Thomas 2018-06-13 22:58:53 +10:00
  • ecf21e4cc9 Add support for maps. Alec Thomas 2018-06-13 22:16:43 +10:00
  • 54386f7fa5 Track trace values externally to the path. Alec Thomas 2018-06-13 21:41:55 +10:00
  • c7dca86dad Rename Value.Value to Value.Target to correctly reflect its purpose. Alec Thomas 2018-06-13 21:12:56 +10:00
  • 29fe92f286 Only reset grammar when Apply()ing. Alec Thomas 2018-06-13 12:07:35 +10:00
  • 9db476cc81 Doc tweaks. Alec Thomas 2018-06-13 10:53:40 +10:00
  • 232faad0a0 Add configuration loading + docs + linter fixes. Alec Thomas 2018-06-13 10:33:22 +10:00
  • a5c97373ba Remove automatic envar naming resolver. Alec Thomas 2018-06-13 08:40:41 +10:00
  • 0aec63e1ba Add logo. Alec Thomas 2018-06-12 23:25:58 +10:00
  • 0fb3de514f Add a default-enabled EnvResolver for the env tag. Alec Thomas 2018-06-12 20:54:29 +10:00