aliases
This commit is contained in:
parent
8249488f25
commit
874712bbb2
@ -12,6 +12,7 @@ func init() {
|
||||
|
||||
var likeCmd = &cobra.Command{
|
||||
Use: "like",
|
||||
Aliases: []string{"l"},
|
||||
Short: "Likes song",
|
||||
Long: `Likes song`,
|
||||
Run: func(cmd *cobra.Command, args []string) {
|
||||
|
21
src/cmd/next.go
Normal file
21
src/cmd/next.go
Normal file
@ -0,0 +1,21 @@
|
||||
package cmd
|
||||
|
||||
import (
|
||||
"gospt/src/commands"
|
||||
|
||||
"github.com/spf13/cobra"
|
||||
)
|
||||
|
||||
func init() {
|
||||
rootCmd.AddCommand(nextCmd)
|
||||
}
|
||||
|
||||
var nextCmd = &cobra.Command{
|
||||
Use: "next",
|
||||
Aliases: []string{"n"},
|
||||
Short: "Skip to next song",
|
||||
Long: `Skip to next song`,
|
||||
Run: func(cmd *cobra.Command, args []string) {
|
||||
commands.Next(ctx, client)
|
||||
},
|
||||
}
|
@ -12,6 +12,7 @@ func init() {
|
||||
|
||||
var playCmd = &cobra.Command{
|
||||
Use: "play",
|
||||
Aliases: []string{"p"},
|
||||
Short: "Plays spotify",
|
||||
Long: `Plays queued song on spotify, uses last used device and activates it if needed`,
|
||||
Run: func(cmd *cobra.Command, args []string) {
|
||||
|
@ -12,6 +12,7 @@ func init() {
|
||||
|
||||
var previousCmd = &cobra.Command{
|
||||
Use: "previous",
|
||||
Aliases: []string{"b"},
|
||||
Short: "goes to previous song",
|
||||
Long: `if song is playing it will start over, if close to begining of song it will go to previous song`,
|
||||
Run: func(cmd *cobra.Command, args []string) {
|
||||
|
@ -12,6 +12,7 @@ func init() {
|
||||
|
||||
var radioCmd = &cobra.Command{
|
||||
Use: "radio",
|
||||
Aliases: []string{"r"},
|
||||
Short: "Starts radio",
|
||||
Long: `Starts radio`,
|
||||
RunE: func(cmd *cobra.Command, args []string) error {
|
||||
|
@ -12,6 +12,7 @@ func init() {
|
||||
|
||||
var refillRadioCmd = &cobra.Command{
|
||||
Use: "refillradio",
|
||||
Aliases: []string{"rr"},
|
||||
Short: "Refills the radio",
|
||||
Long: `Deletes all songs up to your position in the radio and adds that many songs to the end of the radio`,
|
||||
Run: func(cmd *cobra.Command, args []string) {
|
||||
|
@ -1,20 +0,0 @@
|
||||
package cmd
|
||||
|
||||
import (
|
||||
"gospt/src/commands"
|
||||
|
||||
"github.com/spf13/cobra"
|
||||
)
|
||||
|
||||
func init() {
|
||||
rootCmd.AddCommand(skipCmd)
|
||||
}
|
||||
|
||||
var skipCmd = &cobra.Command{
|
||||
Use: "skip",
|
||||
Short: "Skip to next song",
|
||||
Long: `Skip to next song`,
|
||||
Run: func(cmd *cobra.Command, args []string) {
|
||||
commands.Skip(ctx, client)
|
||||
},
|
||||
}
|
@ -12,6 +12,7 @@ func init() {
|
||||
|
||||
var togglePlayCmd = &cobra.Command{
|
||||
Use: "toggleplay",
|
||||
Aliases: []string{"t"},
|
||||
Short: "Toggles the play state of spotify",
|
||||
Long: `If you are playing a song it will pause and if a song is paused it will play`,
|
||||
Run: func(cmd *cobra.Command, args []string) {
|
||||
|
@ -499,7 +499,7 @@ func Unlike(ctx *gctx.Context, client *spotify.Client) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func Skip(ctx *gctx.Context, client *spotify.Client) error {
|
||||
func Next(ctx *gctx.Context, client *spotify.Client) error {
|
||||
err := client.Next(ctx)
|
||||
if err != nil {
|
||||
return err
|
||||
|
Loading…
Reference in New Issue
Block a user