setdevice
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful

This commit is contained in:
abs3nt 2024-02-18 11:14:21 -08:00
parent e88a964b3a
commit 1747097e7a
Signed by: abs3nt
GPG Key ID: A7BD96A8BAB04C09

View File

@ -1,6 +1,7 @@
package cli
import (
"fmt"
"log/slog"
"os"
"strconv"
@ -213,9 +214,14 @@ func Run(c *commands.Commander, s fx.Shutdowner) {
},
},
{
Name: "setdevice",
Usage: "Set the active device",
Name: "setdevice",
Usage: "Set the active device",
Args: true,
ArgsUsage: "<device_id>",
Action: func(cCtx *cli.Context) error {
if cCtx.NArg() == 0 {
return fmt.Errorf("no device id provided")
}
return c.SetDevice(spotify.ID(cCtx.Args().First()))
},
},