|
| 1 | +package playlistImage |
| 2 | + |
| 3 | +import ( |
| 4 | + "github.com/eat-pray-ai/yutu/pkg/playlistImage" |
| 5 | + "github.com/spf13/cobra" |
| 6 | +) |
| 7 | + |
| 8 | +var listCmd = &cobra.Command{ |
| 9 | + Use: "list", |
| 10 | + Short: "List YouTube playlist images", |
| 11 | + Long: "List YouTube playlist images' info", |
| 12 | + Run: func(cmd *cobra.Command, args []string) { |
| 13 | + pi := playlistImage.NewPlaylistImage( |
| 14 | + playlistImage.WithParent(parent), |
| 15 | + playlistImage.WithOnBehalfOfContentOwner(onBehalfOfContentOwner), |
| 16 | + playlistImage.WithOnBehalfOfContentOwnerChannel(onBehalfOfContentOwnerChannel), |
| 17 | + playlistImage.WithMaxResults(maxResults), |
| 18 | + playlistImage.WithService(nil), |
| 19 | + ) |
| 20 | + pi.List(parts, output) |
| 21 | + }, |
| 22 | +} |
| 23 | + |
| 24 | +func init() { |
| 25 | + playlistImageCmd.AddCommand(listCmd) |
| 26 | + |
| 27 | + listCmd.Flags().StringVarP(&parent, "parent", "p", "", "Return PlaylistImages for this playlist id") |
| 28 | + listCmd.Flags().StringVarP(&onBehalfOfContentOwner, "onBehalfOfContentOwner", "b", "", "") |
| 29 | + listCmd.Flags().StringVarP(&onBehalfOfContentOwnerChannel, "onBehalfOfContentOwnerChannel", "B", "", "") |
| 30 | + listCmd.Flags().Int64VarP(&maxResults, "maxResults", "n", 5, "The maximum number of items that should be returned") |
| 31 | + listCmd.Flags().StringSliceVarP(&parts, "parts", "p", []string{"id", "kind", "snippet"}, "Comma separated parts") |
| 32 | + listCmd.Flags().StringVarP(&output, "output", "o", "", "json or yaml") |
| 33 | +} |
0 commit comments