diff --git a/src/cmd/like.go b/src/cmd/like.go index f8391cc..30c5d85 100644 --- a/src/cmd/like.go +++ b/src/cmd/like.go @@ -11,9 +11,10 @@ func init() { } var likeCmd = &cobra.Command{ - Use: "like", - Short: "Likes song", - Long: `Likes song`, + Use: "like", + Aliases: []string{"l"}, + Short: "Likes song", + Long: `Likes song`, Run: func(cmd *cobra.Command, args []string) { commands.Like(ctx, client) }, diff --git a/src/cmd/next.go b/src/cmd/next.go new file mode 100644 index 0000000..961358b --- /dev/null +++ b/src/cmd/next.go @@ -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) + }, +} diff --git a/src/cmd/play.go b/src/cmd/play.go index 7e94132..d5bd04d 100644 --- a/src/cmd/play.go +++ b/src/cmd/play.go @@ -11,9 +11,10 @@ func init() { } var playCmd = &cobra.Command{ - Use: "play", - Short: "Plays spotify", - Long: `Plays queued song on spotify, uses last used device and activates it if needed`, + 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) { commands.Play(ctx, client) }, diff --git a/src/cmd/previous.go b/src/cmd/previous.go index ab15e84..a55adda 100644 --- a/src/cmd/previous.go +++ b/src/cmd/previous.go @@ -11,9 +11,10 @@ func init() { } var previousCmd = &cobra.Command{ - Use: "previous", - 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`, + 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) { commands.Previous(ctx, client) }, diff --git a/src/cmd/radio.go b/src/cmd/radio.go index 495cecb..945e475 100644 --- a/src/cmd/radio.go +++ b/src/cmd/radio.go @@ -11,9 +11,10 @@ func init() { } var radioCmd = &cobra.Command{ - Use: "radio", - Short: "Starts radio", - Long: `Starts radio`, + Use: "radio", + Aliases: []string{"r"}, + Short: "Starts radio", + Long: `Starts radio`, RunE: func(cmd *cobra.Command, args []string) error { return commands.Radio(ctx, client) }, diff --git a/src/cmd/refillradio.go b/src/cmd/refillradio.go index aa0563d..05f91fa 100644 --- a/src/cmd/refillradio.go +++ b/src/cmd/refillradio.go @@ -11,9 +11,10 @@ func init() { } var refillRadioCmd = &cobra.Command{ - Use: "refillradio", - 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`, + 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) { commands.RefillRadio(ctx, client) }, diff --git a/src/cmd/skip.go b/src/cmd/skip.go deleted file mode 100644 index 02ebe45..0000000 --- a/src/cmd/skip.go +++ /dev/null @@ -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) - }, -} diff --git a/src/cmd/toggleplay.go b/src/cmd/toggleplay.go index ad31bdc..423bad5 100644 --- a/src/cmd/toggleplay.go +++ b/src/cmd/toggleplay.go @@ -11,9 +11,10 @@ func init() { } var togglePlayCmd = &cobra.Command{ - Use: "toggleplay", - 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`, + 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) { commands.TogglePlay(ctx, client) }, diff --git a/src/commands/commands.go b/src/commands/commands.go index 3a24ab4..e7019b6 100644 --- a/src/commands/commands.go +++ b/src/commands/commands.go @@ -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