| @@ -18,14 +18,16 @@ func init() { | |||||
| rootCmd.AddCommand(cmd) | rootCmd.AddCommand(cmd) | ||||
| outputJSON := rootCmd.Flags().BoolP("json", "j", false, "output in JSON format") | |||||
| cmd.AddCommand(&cobra.Command{ | |||||
| outputJSON := false | |||||
| watchCmd := &cobra.Command{ | |||||
| Use: "watch", | Use: "watch", | ||||
| Short: "Watch system events", | Short: "Watch system events", | ||||
| Run: func(cmd *cobra.Command, args []string) { | Run: func(cmd *cobra.Command, args []string) { | ||||
| watchSysEvent(*outputJSON) | |||||
| watchSysEvent(outputJSON) | |||||
| }, | }, | ||||
| }) | |||||
| } | |||||
| watchCmd.Flags().BoolVarP(&outputJSON, "json", "j", false, "output in JSON format") | |||||
| cmd.AddCommand(watchCmd) | |||||
| } | } | ||||
| func watchSysEvent(outputJSON bool) { | func watchSysEvent(outputJSON bool) { | ||||