You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If you have different flags that must be provided together (e.g. if they provide the `--username` flag they MUST provide the `--password` flag as well) then
337
340
Cobra can enforce that requirement:
341
+
338
342
```go
339
343
rootCmd.Flags().StringVarP(&u, "username", "u", "", "Username (required if password is set)")
340
344
rootCmd.Flags().StringVarP(&pw, "password", "p", "", "Password (required if username is set)")
You can also explicitly set names for which a given command will be suggested using the `SuggestFor` attribute. This allows suggestions for strings that are not close in terms of string distance, but make sense in your set of commands but for which
0 commit comments