diff --git a/cmd/generate.go b/cmd/generate.go index 8ce2093..c373b9b 100644 --- a/cmd/generate.go +++ b/cmd/generate.go @@ -20,7 +20,6 @@ var ( tokenFetchRetries int templatePaths []string pluginPath string - cacertPath string useCompression bool ) @@ -175,7 +174,6 @@ func init() { generateCmd.Flags().StringSliceVar(&templatePaths, "template", []string{}, "set the paths for the Jinja 2 templates to use") generateCmd.Flags().StringVar(&pluginPath, "plugin", "", "set the generator plugin path") generateCmd.Flags().StringVarP(&outputPath, "output", "o", "", "set the output path for config targets") - generateCmd.Flags().StringVar(&cacertPath, "cacert", "", "path to CA cert. (defaults to system CAs)") generateCmd.Flags().IntVar(&tokenFetchRetries, "fetch-retries", 5, "set the number of retries to fetch an access token") generateCmd.Flags().StringVar(&remoteHost, "host", "http://localhost", "set the remote host") generateCmd.Flags().IntVar(&remotePort, "port", 80, "set the remote port") diff --git a/cmd/root.go b/cmd/root.go index 26ccba7..6d323aa 100644 --- a/cmd/root.go +++ b/cmd/root.go @@ -10,8 +10,9 @@ import ( ) var ( - configPath string config configurator.Config + configPath string + cacertPath string verbose bool targets []string outputPath string @@ -42,6 +43,7 @@ func init() { cobra.OnInitialize(initConfig) rootCmd.PersistentFlags().StringVarP(&configPath, "config", "c", "./config.yaml", "set the config path") rootCmd.PersistentFlags().BoolVarP(&verbose, "verbose", "v", false, "set to enable verbose output") + rootCmd.PersistentFlags().StringVar(&cacertPath, "cacert", "", "path to CA cert. (defaults to system CAs)") } func initConfig() {