♻️ Flag variable name to lowercase

This commit is contained in:
chaoqun committed 2024-07-23 22:26:43 +08:00
1 parent c22a334eff
commit 85995d4754
4 files changed
+27 -25

No files matched your search

+14 -12
View File
@@ -6,18 +6,20 @@ import (
)
var (
IDs []string
AuthorChannelId string
CanRate bool
ChannelId string
MaxResults int64
ParentId string
TextFormat string
TextOriginal string
ModerationStatus string
BanAuthor bool
VideoId string
ViewerRating string
ids []string
authorChannelId string
canRate bool
channelId string
maxResults int64
parentId string
textFormat string
textOriginal string
moderationStatus string
banAuthor bool
videoId string
viewerRating string
parts []string
output string
)
var commentCmd = &cobra.Command{
+3 -3
View File
@@ -8,10 +8,10 @@ import (
var deleteCmd = &cobra.Command{
Use: "delete",
Short: "Delete YouTube comments",
Long: "Delete YouTube comments by IDs",
Long: "Delete YouTube comments by ids",
Run: func(cmd *cobra.Command, args []string) {
c := comment.NewComment(
comment.WithIDs(IDs),
comment.WithIDs(ids),
comment.WithService(nil),
)
c.Delete()
@@ -21,5 +21,5 @@ var deleteCmd = &cobra.Command{
func init() {
commentCmd.AddCommand(deleteCmd)
deleteCmd.Flags().StringSliceVarP(&IDs, "ids", "i", []string{}, "Comma separated IDs of comments")
deleteCmd.Flags().StringSliceVarP(&ids, "ids", "i", []string{}, "Comma separated ids of comments")
}
+3 -3
View File
@@ -8,10 +8,10 @@ import (
var markAsSpamCmd = &cobra.Command{
Use: "markAsSpam",
Short: "Mark YouTube comments as spam",
Long: "Mark YouTube comments as spam by IDs",
Long: "Mark YouTube comments as spam by ids",
Run: func(cmd *cobra.Command, args []string) {
c := comment.NewComment(
comment.WithIDs(IDs),
comment.WithIDs(ids),
comment.WithService(nil),
)
c.MarkAsSpam(false)
@@ -21,5 +21,5 @@ var markAsSpamCmd = &cobra.Command{
func init() {
commentCmd.AddCommand(markAsSpamCmd)
markAsSpamCmd.Flags().StringSliceVarP(&IDs, "ids", "i", []string{}, "Comma separated IDs of comments")
markAsSpamCmd.Flags().StringSliceVarP(&ids, "ids", "i", []string{}, "Comma separated ids of comments")
}
+7 -7
View File
@@ -8,12 +8,12 @@ import (
var setModerationStatusCmd = &cobra.Command{
Use: "setModerationStatus",
Short: "Set YouTube comments moderation status",
Long: "Set YouTube comments moderation status by IDs",
Long: "Set YouTube comments moderation status by ids",
Run: func(cmd *cobra.Command, args []string) {
c := comment.NewComment(
comment.WithIDs(IDs),
comment.WithModerationStatus(ModerationStatus),
comment.WithBanAuthor(BanAuthor, true),
comment.WithIDs(ids),
comment.WithModerationStatus(moderationStatus),
comment.WithBanAuthor(banAuthor, true),
)
c.SetModerationStatus(false)
},
@@ -22,9 +22,9 @@ var setModerationStatusCmd = &cobra.Command{
func init() {
commentCmd.AddCommand(setModerationStatusCmd)
setModerationStatusCmd.Flags().StringSliceVarP(&IDs, "ids", "i", []string{}, "Comma separated IDs of comments")
setModerationStatusCmd.Flags().StringSliceVarP(&ids, "ids", "i", []string{}, "Comma separated ids of comments")
setModerationStatusCmd.Flags().StringVarP(
&ModerationStatus, "moderationStatus", "s", "", "heldForReview, published or rejected",
&moderationStatus, "moderationStatus", "s", "", "heldForReview, published or rejected",
)
setModerationStatusCmd.Flags().BoolVarP(&BanAuthor, "banAuthor", "b", false, "true or false")
setModerationStatusCmd.Flags().BoolVarP(&banAuthor, "banAuthor", "b", false, "true or false")
}