Flyctl commands that need mutually-exclusive/required-together/one-of flag validation (e.g. mpg restore's --backup-id/--pitr-time) currently do this by hand in command logic. Cobra ships built-in helpers for this — MarkFlagsMutuallyExclusive, MarkFlagsOneRequired, MarkFlagsRequiredTogether — which validate at flag-parse time with consistent error messages, but they're currently unused anywhere in the codebase (only plain MarkFlagRequired is used, in certificates/root.go).
Worth evaluating whether migrating existing manual flag-combination checks to these helpers would reduce duplicated validation logic and give users more consistent error messages across commands.
Flyctl commands that need mutually-exclusive/required-together/one-of flag validation (e.g.
mpg restore's--backup-id/--pitr-time) currently do this by hand in command logic. Cobra ships built-in helpers for this —MarkFlagsMutuallyExclusive,MarkFlagsOneRequired,MarkFlagsRequiredTogether— which validate at flag-parse time with consistent error messages, but they're currently unused anywhere in the codebase (only plainMarkFlagRequiredis used, incertificates/root.go).Worth evaluating whether migrating existing manual flag-combination checks to these helpers would reduce duplicated validation logic and give users more consistent error messages across commands.