noLocalFlagSet returns true if no local flags (excluding global flags) are set for the command.
(cmd *cobra.Command)
| 176 | |
| 177 | // noLocalFlagSet returns true if no local flags (excluding global flags) are set for the command. |
| 178 | func noLocalFlagSet(cmd *cobra.Command) bool { |
| 179 | localFlagIsSet := false |
| 180 | cmd.LocalFlags().VisitAll(func(f *pflag.Flag) { |
| 181 | if f.Changed && f.Name != "json" && f.Name != "json-compact" && f.Name != "tenant" && f.Name != "force" && f.Name != "debug" && f.Name != "no-color" { |
| 182 | localFlagIsSet = true |
| 183 | return |
| 184 | } |
| 185 | }) |
| 186 | |
| 187 | return !localFlagIsSet |
| 188 | } |
| 189 | |
| 190 | func prepareInteractivity(cmd *cobra.Command) { |
| 191 | if canPrompt(cmd) || !iostream.IsInputTerminal() { |
no outgoing calls
no test coverage detected