Allow for change of update frequency for watching node status

This commit is contained in:
Gregory Kurtzer
2021-12-31 02:46:22 +00:00
parent 39ec7c0807
commit a788db282c
2 changed files with 3 additions and 1 deletions

View File

@@ -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
}

View File

@@ -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.