gospt/cmd/link.go

29 lines
486 B
Go
Raw Permalink Normal View History

2023-01-10 06:37:44 +00:00
package cmd
import (
"fmt"
"os"
"github.com/spf13/cobra"
)
// linkCmd represents the link command
var linkCmd = &cobra.Command{
2023-01-14 07:08:36 +00:00
Use: "link",
Aliases: []string{"yy"},
Short: "Print link to currently playing song",
Long: `Print link to currently playing song`,
2023-01-10 06:37:44 +00:00
Run: func(cmd *cobra.Command, args []string) {
2023-02-17 22:08:25 +00:00
link, err := commands.Link(ctx)
2023-01-10 06:37:44 +00:00
if err != nil {
fmt.Println(err)
os.Exit(1)
}
2023-01-10 07:48:05 +00:00
fmt.Print(link)
2023-01-10 06:37:44 +00:00
},
}
func init() {
rootCmd.AddCommand(linkCmd)
}