Allow for change of update frequency for watching node status
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user