Document flag declaration rules

This commit is contained in:
2026-11-07 15:47:54 +00:00
parent 52f1d99994
commit 3b75ae7d2e
4 changed files with 21 additions and 6 deletions

View File

@@ -64,6 +64,7 @@ func OccurrenceFlag[I, V any](meta FlagMeta, parse func(string) (V, error), set
// RenameFlag returns an independent binding with a new long name and no short
// spelling. Parsing, defaults, completion, requiredness, and setters are retained.
// The name follows the declaration rules in [FlagMeta].
func RenameFlag[I any](flag Flag[I], name string) Flag[I] {
binding := flag.binding
binding.meta.Name = name