0
0
Fork 0
mirror of https://github.com/crazy-max/diun.git synced 2025-04-28 20:52:25 +00:00
crazy-max_diun/vendor/github.com/alecthomas/kong/negatable.go
dependabot[bot] 9a00af98bc
chore(deps): bump github.com/alecthomas/kong from 0.9.0 to 1.6.0
Bumps [github.com/alecthomas/kong](https://github.com/alecthomas/kong) from 0.9.0 to 1.6.0.
- [Commits](https://github.com/alecthomas/kong/compare/v0.9.0...v1.6.0)

---
updated-dependencies:
- dependency-name: github.com/alecthomas/kong
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-12-15 13:31:02 +00:00

19 lines
563 B
Go

package kong
// negatableDefault is a placeholder value for the Negatable tag to indicate
// the negated flag is --no-<flag-name>. This is needed as at the time of
// parsing a tag, the field's flag name is not yet known.
const negatableDefault = "_"
// negatableFlagName returns the name of the flag for a negatable field, or
// an empty string if the field is not negatable.
func negatableFlagName(name, negation string) string {
switch negation {
case "":
return ""
case negatableDefault:
return "--no-" + name
default:
return "--" + negation
}
}