add -seek-by CLI arg

This commit is contained in:
Drew Weymouth
2024-06-23 16:09:50 -07:00
parent 46b7e386f4
commit 17dfa1132f
7 changed files with 44 additions and 10 deletions
+6
View File
@@ -8,6 +8,7 @@ import (
var (
VolumeCLIArg int = -1
SeekToCLIArg float64 = -1
SeekByCLIArg float64 = 0
FlagPlay = flag.Bool("play", false, "unpause or begin playback")
FlagPause = flag.Bool("pause", false, "pause playback")
@@ -30,6 +31,11 @@ func init() {
SeekToCLIArg = v
return err
})
flag.Func("seek-by", "seeks back or forward by the given number of seconds (negative or positive)", func(s string) error {
v, err := strconv.ParseFloat(s, 64)
SeekByCLIArg = v
return err
})
}
func HaveCommandLineOptions() bool {