Commit Graph

16 Commits

Author SHA1 Message Date
Alec Thomas 2544d3f008 feat: add AfterRun() hook
Fixes #288
2024-11-03 14:49:27 +11:00
renovate[bot] c9fbc305f4 chore(deps): update module github.com/alecthomas/assert/v2 to v2.11.0 (#459)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-09-23 10:05:14 +10:00
Camilla ff6d5ba7d5 Feature: Add xand tag (#442)
* Feat: Add xand group and check for missing

* Fix: Split and combine err in TestMultiand for consistency

* Feat: Check missing required flags in xand groups

* Feat: Handle combined xor and xand

* Docs: Add info about combined xand and required use

* Docs: Fix language error in xand description

Co-authored-by: Stautis <thkrst@gmail.com>

* Feat: Rename xand to and

* Refactor: Switch from fmt.Sprintf to err.Error

* Refactor: Get requiredAndGroup map in separate function

---------

Co-authored-by: Stautis <thkrst@gmail.com>
2024-08-08 16:58:22 +10:00
renovate[bot] 605cdd64a9 chore(deps): update all non-major dependencies (#425)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-07-05 22:49:21 +10:00
renovate[bot] 2ab5733f11 chore(deps): update all non-major dependencies (#424)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-04-10 23:12:03 +10:00
renovate[bot] 088cd7874e chore(deps): update all non-major dependencies (#410)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-03-05 10:53:35 +11:00
renovate[bot] 30e84613fe chore(deps): update module github.com/alecthomas/assert/v2 to v2.5.0 (#407)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-01-22 19:21:44 +11:00
Abhinav Gupta 3263463a7e Fix Windows tests, verify in CI (#394)
* ci: Test on Windows too

Adds a Windows test run to CI.
Go setup relies on GHA for this
because Hermit doesn't yet support Windows.

* fix(mapper_windows_test): assert.NotNil => assert.True

assert.NotNil does not exist.

* filecontent mapper: Handle error from directory

If we couldn't read because the source is a directory,
override the original error message.

* fix(test): Handle platform-specific "file not found" messages
2023-12-10 15:42:50 +11:00
Alec Thomas e75e1ca88a refactor: switch to alecthomas/assert 2022-06-21 20:58:10 +10: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
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 9c9b8ab50b More enum fixes. 2021-12-13 18:54:06 +11:00
Toshimaru 9c81441ae0 Update go modules (#165) 2021-05-03 14:16:08 +10:00
Alec Thomas 01b720cb19 Test and docs for TextUnmarshaler and json.Unmarshaler. 2020-01-10 12:15:54 +11:00
Alec Thomas 439c674f7a Use interface{} instead of string in tokens.
This allows the scanner and resolvers to pass Go types around rather
than having to serialise/deserialise to/from strings.
2019-04-24 23:25:13 +10:00
Alec Thomas 2e29ff8981 Add support for setting variables via tag.
This provides much more convenient composition when reusing structs in
different parts of the command grammar.

eg.

	type Embedded struct {
		Key string `help:"A key from ${where}."`
	}

	var cli struct {
		Embedded `set:"where=somewhere"`
	}
2018-09-19 12:57:59 +10:00