if password is set)") rootCmd.Flags().StringVarP(&pw, "password", "p", "", "Password (required if username is set)") rootCmd.MarkFlagsRequiredTogether("username", "password") IUUQTHJUIVCDPNTQGDPCSBCMPCNBJO[email protected]NE fl BHHSPVQT Flag Groups rootCmd.Flags().BoolVar(&u, "json", false, "Output in JSON") rootCmd.Flags().BoolVar(&pw, "yaml", false, "Output in YAML") rootCmd.MarkFlagsMutuallyExclusive("json", "yaml") w 'MBHΛ૬ޓʹഉଞతͳΦϓγϣϯΛද͢߹ 'MBHʹάϧʔϓػೳՃ͢Δͷ؆୯ʹ࣮ݱͰ͖Δ ⭐ӡ༻࣌ʹґཔ͢Δ࣌ʹָ ɹԿ͕Γͳ͍͔ࣔ͢ͷେมʜ
args []string, toComplete string) ([]string, cobra.ShellCompDirective) { var comps []string if len(args) == 0 { comps = cobra.AppendActiveHelp(comps, "You must choose a name for the repo you are adding") } else if len(args) == 1 { comps = cobra.AppendActiveHelp(comps, "You must specify the URL for the repo you are adding") } else { comps = cobra.AppendActiveHelp(comps, "This command does not take any more arguments") } return comps, cobra.ShellCompDirectiveNoFileComp }, bash-5.1$ helm repo add [tab] You must choose a name for the repo you are adding bash-5.1$ helm repo add grafana [tab] You must specify the URL for the repo you are adding bash-5.1$ helm repo add grafana https://grafana.github.io/helm-charts [tab] This command does not take any more arguments ⭐ର࣌ʹָʹͳΔͷͰخ͍͠ɹ fi TIར༻ऀԸܙʹ༬͔Εࢮ