Made user and pass flags required together

This commit is contained in:
David J. Allen 2024-05-10 13:52:00 -06:00
parent e0d02e5651
commit ac86a12ce0
No known key found for this signature in database
GPG key ID: 717C593FF60A2ACC

View file

@ -80,6 +80,7 @@ func init() {
collectCmd.PersistentFlags().StringVarP(&outputPath, "output", "o", fmt.Sprintf("/tmp/%smagellan/data/", currentUser.Username+"/"), "set the path to store collection data")
collectCmd.PersistentFlags().BoolVar(&forceUpdate, "force-update", false, "set flag to force update data sent to SMD")
collectCmd.PersistentFlags().StringVar(&cacertPath, "ca-cert", "", "path to CA cert. (defaults to system CAs)")
collectCmd.MarkFlagsRequiredTogether("user", "pass")
viper.BindPFlag("collect.driver", collectCmd.Flags().Lookup("driver"))
viper.BindPFlag("collect.host", collectCmd.Flags().Lookup("host"))