cli/meter: rename delay to interval
This commit is contained in:
parent
9eb5e33652
commit
a44758a4c8
2 changed files with 6 additions and 6 deletions
|
|
@ -54,10 +54,10 @@ const (
|
|||
flagStop = "stop"
|
||||
flagStopDescription = "Stop charging"
|
||||
|
||||
flagRepeat = "repeat"
|
||||
flagRepeatDescription = "Repeat until interrupted"
|
||||
flagRepeatDelay = "repeat-delay"
|
||||
flagRepeatDelayDescription = "Delay between repeats"
|
||||
flagRepeat = "repeat"
|
||||
flagRepeatDescription = "Repeat until interrupted"
|
||||
flagRepeatInterval = "repeat-interval"
|
||||
flagRepeatIntervalDescription = "Interval between repetitions"
|
||||
|
||||
flagDigits = "digits"
|
||||
flagDelay = "delay"
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@ func init() {
|
|||
meterCmd.Flags().StringP(flagBatteryMode, "b", "", flagBatteryModeDescription)
|
||||
meterCmd.Flags().DurationP(flagBatteryModeWait, "w", 0, flagBatteryModeWaitDescription)
|
||||
meterCmd.Flags().BoolP(flagRepeat, "r", false, flagRepeatDescription)
|
||||
meterCmd.Flags().Duration(flagRepeatDelay, 0, flagRepeatDelayDescription)
|
||||
meterCmd.Flags().Duration(flagRepeatInterval, 0, flagRepeatIntervalDescription)
|
||||
}
|
||||
|
||||
func runMeter(cmd *cobra.Command, args []string) {
|
||||
|
|
@ -77,7 +77,7 @@ func runMeter(cmd *cobra.Command, args []string) {
|
|||
d.DumpWithHeader(dev.Config().Name, v)
|
||||
}
|
||||
if ok, _ := cmd.Flags().GetBool(flagRepeat); ok {
|
||||
if d, err := cmd.Flags().GetDuration(flagRepeatDelay); d > 0 && err == nil {
|
||||
if d, err := cmd.Flags().GetDuration(flagRepeatInterval); d > 0 && err == nil {
|
||||
log.INFO.Println("waiting for:", d)
|
||||
time.Sleep(d)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue