gospt/cmd/linkcontext.go

29 lines
528 B
Go
Raw Normal View History

2023-01-27 06:28:57 +00:00
package cmd
import (
"fmt"
"os"
"github.com/spf13/cobra"
)
// linkCmd represents the link command
var linkContextCmd = &cobra.Command{
Use: "linkcontext",
Aliases: []string{"lc"},
Short: "Get url to current context(album, playlist)",
Long: `Get url to current context(album, playlist)`,
Run: func(cmd *cobra.Command, args []string) {
2023-02-17 22:08:25 +00:00
link, err := commands.LinkContext(ctx)
2023-01-27 06:28:57 +00:00
if err != nil {
fmt.Println(err)
os.Exit(1)
}
fmt.Print(link)
},
}
func init() {
rootCmd.AddCommand(linkContextCmd)
}