Repository navigation
Conversation
Use delegation to implement the Value+Flag paradigm used for other flag types. Implement all of the Flag interfaces except Count. Borrowed heavily from flag_bool.go and flag_generic.go Add context to the error message when setting an external flag's value to its default value to avoid cryptic error messages like: `"syntax error: expected file.go:234"` And suppress the error for odd-ball external flags that report the string representation of the zero-value of some structure as the default, but do not accept that string as input. Detect such odd-balls by their `Get()` method returning `nil`.
Bumps [actions/checkout](https://github.com/actions/checkout) from 5 to 6. - [Release notes](https://github.com/actions/checkout/releases) - [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md) - [Commits](actions/checkout@v5...v6) --- updated-dependencies: - dependency-name: actions/checkout dependency-version: '6' dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com>
Bumps the python-packages group with 1 update: [mkdocs-material](https://github.com/squidfunk/mkdocs-material). Updates `mkdocs-material` from 9.6.23 to 9.7.0 - [Release notes](https://github.com/squidfunk/mkdocs-material/releases) - [Changelog](https://github.com/squidfunk/mkdocs-material/blob/master/CHANGELOG) - [Commits](squidfunk/mkdocs-material@9.6.23...9.7.0) --- updated-dependencies: - dependency-name: mkdocs-material dependency-version: 9.7.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: python-packages ... Signed-off-by: dependabot[bot] <support@github.com>
Include an empty argument and all subsequent arguments.
| // skip test flags | ||
| if !strings.HasPrefix(f.Name, ignoreFlagPrefix) { | ||
| cmd.Flags = append(cmd.Flags, &extFlag{f}) | ||
| cmd.Flags = append(cmd.Flags, &extFlag{f, ""}) |
There was a problem hiding this comment.
Please remove this change from this PR.
| package cli | ||
|
|
||
| import "flag" | ||
| import ( |
There was a problem hiding this comment.
Please remove this from PR
|
@bbadour try to focus on one issue per PR. |
|
Thanks for the fix, and sorry this sat so long. This bug is already fixed on main. #2296 fixed it (released in v3.8.0) when it was reported again as #2292, and #2328 added a regression test with the repro from #2234: Lines 91 to 95 in e03df0f Lines 7523 to 7568 in e03df0f The fix on main keeps the empty arg and keeps parsing flags after it. This PR stops parsing flags at the empty arg, so with The Closing as superseded. Thanks again! |
Include an empty argument and all subsequent arguments.
What type of PR is this?
What this PR does / why we need it:
Sometimes command line arguments are empty strings.
i.e.
Which issue(s) this PR fixes:
Fixes #2234
Release Notes