fix(collect): don;t require both creds flags

This commit is contained in:
Devon Bautista 2025-04-16 17:31:20 -06:00 committed by David Allen
parent 0ed861e3a7
commit 7bcd2f9462
Signed by: towk
GPG key ID: 0430CDBE22619155

View file

@ -151,9 +151,6 @@ func init() {
CollectCmd.PersistentFlags().BoolVar(&forceUpdate, "force-update", false, "Set flag to force update data sent to SMD")
CollectCmd.PersistentFlags().StringVar(&cacertPath, "cacert", "", "Set the path to CA cert file. (defaults to system CAs when blank)")
// set flags to only be used together
CollectCmd.MarkFlagsRequiredTogether("username", "password")
// bind flags to config properties
checkBindFlagError(viper.BindPFlag("collect.host", CollectCmd.Flags().Lookup("host")))
checkBindFlagError(viper.BindPFlag("collect.scheme", CollectCmd.Flags().Lookup("scheme")))