-
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
6a77377
commit bf1ac4a
Showing
5 changed files
with
51 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
package video | ||
|
||
import ( | ||
"github.com/eat-pray-ai/yutu/pkg/yutuber" | ||
|
||
"github.com/spf13/cobra" | ||
) | ||
|
||
var rateCmd = &cobra.Command{ | ||
Use: "rate", | ||
Short: "rate a video on YouTube", | ||
Long: "rate a video on YouTube, with the specified rating", | ||
Run: func(cmd *cobra.Command, args []string) { | ||
v := yutuber.NewVideo( | ||
yutuber.WithVideoId(id), | ||
yutuber.WithVideoRating(rating), | ||
) | ||
v.Rate() | ||
}, | ||
} | ||
|
||
func init() { | ||
videoCmd.AddCommand(rateCmd) | ||
|
||
rateCmd.Flags().StringVarP(&id, "id", "i", "", "ID of the video") | ||
rateCmd.Flags().StringVarP(&rating, "rating", "r", "", "Rating of the video") | ||
|
||
rateCmd.MarkFlagRequired("id") | ||
rateCmd.MarkFlagRequired("rating") | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters