diff --git a/internal/app/wwctl/node/status/main.go b/internal/app/wwctl/node/status/main.go index 2d23099d..279c72c9 100644 --- a/internal/app/wwctl/node/status/main.go +++ b/internal/app/wwctl/node/status/main.go @@ -103,7 +103,7 @@ func CobraRunE(cmd *cobra.Command, args []string) error { if elipsis { fmt.Printf("... ") } - time.Sleep(1000 * time.Millisecond) + time.Sleep(time.Duration(SetUpdate) * time.Millisecond) } else { break } diff --git a/internal/app/wwctl/node/status/root.go b/internal/app/wwctl/node/status/root.go index af385d41..6c9a1dc1 100644 --- a/internal/app/wwctl/node/status/root.go +++ b/internal/app/wwctl/node/status/root.go @@ -12,10 +12,12 @@ var ( Args: cobra.MinimumNArgs(0), } SetWatch bool + SetUpdate int16 ) func init() { baseCmd.PersistentFlags().BoolVarP(&SetWatch, "watch", "w", false, "Watch the status automatically") + baseCmd.PersistentFlags().Int16VarP(&SetUpdate, "update", "u", 500, "Set the update frequency for 'watch' (ms)") } // GetRootCommand returns the root cobra.Command for the application.