diff --git a/internal/cli/flags.go b/internal/cli/flags.go index cd06c4358..22474c86e 100644 --- a/internal/cli/flags.go +++ b/internal/cli/flags.go @@ -15,6 +15,9 @@ type Flag struct { IsRequired bool } +// Required clones an existing flag and assigns `IsRequired` to true. This is +// useful when there are flags with several different use cases -- e.g. create +// requiring the flag, but update not requiring it. func (f *Flag) Required() *Flag { clone := *f clone.IsRequired = true