Commit Graph

345 Commits

Author SHA1 Message Date
Alec Thomas 575d5b1d34 fix: set trailing positional arguments to active
This fixes an issue where existingfile et al would not correctly apply
to positional arguments with defaults.
2023-11-17 16:56:45 +11:00
Alec Thomas 0ecd272e23 fix: use LookupEnv to check if envar is actually set
Fixes #389
2023-11-14 09:37:35 +11:00
eli 2df767872e fix for counter type rendering as INT (#388)
closes #367
2023-11-13 17:08:13 +11:00
Jan Heuermann 93d31e17f4 Drop automatic message prefix from command errors (#384) 2023-10-07 18:15:33 +11:00
Alec Thomas 46c03841ed fix: support IsBool() on MapperValue implementations.
Fixes #381
2023-09-30 16:11:22 +08:00
Alec Thomas 2af1ea57d6 docs: add list of configuration loaders to README 2023-09-22 20:33:51 +10:00
Artem Klevtsov 1e6f15faac Add EnvFlag util (#378) 2023-09-17 09:39:43 +10:00
Mitar 074ccd0906 fix: remove showing app name twice in errors (#368) 2023-07-21 22:08:56 +10:00
dependabot[bot] a9be85c4d3 Bump golang.org/x/crypto in /_examples/server (#352)
Bumps [golang.org/x/crypto](https://github.com/golang/crypto) from 0.0.0-20200117160349-530e935923ad to 0.1.0.
- [Release notes](https://github.com/golang/crypto/releases)
- [Commits](https://github.com/golang/crypto/commits/v0.1.0)

---
updated-dependencies:
- dependency-name: golang.org/x/crypto
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-02-24 17:39:03 -08:00
Denis Titusov 9610ed62d9 feat: support multiple env variables (#349) 2023-02-01 06:39:30 +11:00
Florian Loch 37e801405f fix: handle contents of tags properly by unquoting them when necessary 2023-01-26 03:52:22 +11:00
Alec Thomas 95a465b4b5 feat: add FlagNamer option
Fixes #347
2023-01-13 09:34:44 -05:00
Alec Thomas 919e70103f feat: add filecontent named mapper 2022-11-30 22:27:36 +11:00
Alec Thomas 9b08b89396 fix: ensure pointers can be detected as bools
This required adding a BoolMapperExt interface.
2022-11-26 11:21:39 +11:00
Alec Thomas bf0cbf5d7c feat: Embed() option and Context.Call()
The former allows arbitrary structs to be embedded in the root of the
CLI, with optional tags.

The latter allows an arbitrary function to be called using Kong's
binding functionality.
2022-11-22 23:34:56 +11:00
Alec Thomas d974d7270a feat: add support for camelCase JSON keys 2022-11-13 10:16:22 +11:00
Jan Heuermann 32e8ffc6fd Fix large number processing for unsigned types 2022-10-18 08:54:38 +11:00
Sever Băneșiu c62bf25854 Fix loading large integers from JSON files (#334) 2022-09-22 10:10:58 +10:00
Alec Thomas 8b826182d8 fix: tests 2022-09-21 07:33:27 +10:00
Jacob Hochstetler 0c6a9f3a3d Merging issue 280 with master changes (#296) 2022-09-20 05:55:05 -07:00
Michal Kralik 9c8b401de0 Cumulative argument needs to be last (#331) 2022-09-20 05:47:41 -07:00
noisersup 15aa6d8d4e Fix Readme.md 2022-09-17 15:11:48 +10:00
Michal Kralik 3371bd6167 fix: go1.19 specific tests for text wrapping 2022-08-26 18:53:26 +10:00
pyqlsa f48da244f5 change VersionFlag to a BeforeReset hook 2022-07-28 16:15:07 +10:00
pyqlsa a05a0c20ba Add Active member to Nodes and Values (#319) 2022-07-19 22:43:15 -07:00
Michal Kralik f9bc630ef8 Panic on duplicate command names (#317) 2022-07-17 02:31:21 -07:00
Alec Thomas 81070a043b fix: os-specific builds 2022-06-21 22:36:59 +10:00
Alec Thomas e75e1ca88a refactor: switch to alecthomas/assert 2022-06-21 20:58:10 +10:00
Alec Thomas 0066abb973 fix: Reset() should always be called before anything else 2022-06-15 20:45:10 +10:00
pyq-lsa edc47ebc34 helpful error message when flag is missing values (#310)
Fixes #277
2022-06-11 14:29:19 -07:00
James Lamb 9d72e94240 Update yaml v3 to v3.0.1 to fix CVE 2022 28948 (#309) 2022-06-09 19:16:25 -07:00
Keilin Olsen 195d56c42e Remove references to flag HelpProviders
As these don't appear to be currently supported, remove references
to them working (from main README)
2022-05-18 01:07:21 -07:00
Keilin Olsen 6042c4b10e Add example of HelpProvider + README
Relocate detailed help docs to main README
2022-05-18 01:07:21 -07:00
Keilin Olsen 1db2ea27af Move old shell/main to subdirectory
Also update README reference to same
2022-05-18 01:07:21 -07:00
pyq-lsa 0aaa4c1199 fix: existing file/dir always checks default
updated existing file/dir mappers to early return if already set;
added tests for existing file/dir mappers;
2022-05-16 15:37:38 -07:00
David Shiflet 3c2164486d fix linux build 2022-05-16 14:14:04 -07:00
David Shiflet 29685e7da6 treat \ as escape only before a separator 2022-05-16 13:03:54 -07:00
pyq-lsa 5538b7f045 change help hook and call Reset later
change to BeforeResolve hook to catch calls to '--help' earlier;
call reset later in Kong.Parse() to allow help hook to get hooked;
add test;
2022-05-03 00:10:19 -07:00
Alec Thomas 7c6ff10d33 fix: values that look like flags would not be parsed correctly
Specifically, when parsing into slices or maps.

Fixes #290
2022-04-08 06:43:08 +10:00
Alec Thomas 556f8b773b chore: pin Go-1.17.8 2022-03-18 18:56:02 +11:00
Denis Titusov 89b2806f6a Switch to the standard errors API, that was introduced in 1.13 (#273)
* Switch to the standard errors API, that was introduced in 1.13

* Fix linter errors 🤦‍

* Remove withStackError

* fix: freeze go version to 1.17, since 1.18 introduced generics, which are not supported by linters yet

* fix: freeze go version to 1.17, since 1.18 introduced generics, which are not supported by linters yet
2022-03-18 18:54:29 +11:00
Alec Thomas 7a63525420 feat: AutoGroup option 2022-03-11 22:51:12 +11:00
hasheddan 1939f2cda0 Remove extraneous + in README.md
Removes + characters that were included from a previous diff.

Signed-off-by: hasheddan <georgedanielmangum@gmail.com>
2022-02-27 11:14:26 +11:00
Ali Eren Öztürk cc81f03a38 Support listing enums in specified order (#274) 2022-02-21 21:36:14 +11:00
Alec Thomas 72024dd44a fix: hydrate pointer fields
It is a mystery how this has been a bug for so long.
2022-02-16 13:26:29 +11:00
pyq-lsa ab085f771e fix required/xor behavior w/ > 2 flags 2022-01-30 09:13:18 +11:00
Denis Titusov e49700181c fix: Change the application flags order avoiding panics
This commit solves issue alecthomas/kong#264
2022-01-27 22:52:55 +11:00
leon332157 38c56226ba fix: correct line number for json example (#265) 2022-01-25 07:45:25 +11:00
Alec Thomas 3987efba86 fix: issue with symlinked temp dirs 2022-01-05 20:01:51 +11:00
Mitar a7d3850e80 Cmd can be passthrough now, too.
Fixes #253.
2022-01-05 18:58:37 +11:00