Skip to content

Commit

Permalink
✨ add inventory-template flags to serve command (#1335)
Browse files Browse the repository at this point in the history
  • Loading branch information
slntopp authored Jun 19, 2024
1 parent 767bb6e commit f6ff46e
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions apps/cnspec/cmd/serve.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ func init() {
serveCmd.Flags().Int("splay", cnspec_config.DefaultScanIntervalSplay, "randomize the timer by up to this many minutes")
// set inventory
serveCmd.Flags().String("inventory-file", "", "Set the path to the inventory file")
_ = serveCmd.Flags().String("inventory-template", "", "Set the path to the inventory template.")
_ = serveCmd.Flags().MarkHidden("inventory-template")
}

var serveCmd = &cobra.Command{
Expand All @@ -49,6 +51,7 @@ var serveCmd = &cobra.Command{
_ = viper.BindPFlag("scan_interval.timer", cmd.Flags().Lookup("timer"))
_ = viper.BindPFlag("scan_interval.splay", cmd.Flags().Lookup("splay"))
_ = viper.BindPFlag("inventory-file", cmd.Flags().Lookup("inventory-file"))
_ = viper.BindPFlag("inventory-template", cmd.Flags().Lookup("inventory-template"))
logger.StandardZerologLogger()
},
RunE: func(cmd *cobra.Command, args []string) error {
Expand Down

0 comments on commit f6ff46e

Please sign in to comment.