37 lines
931 B
Go
37 lines
931 B
Go
package cmd
|
|
|
|
import (
|
|
"fmt"
|
|
|
|
"github.com/spf13/cobra"
|
|
)
|
|
|
|
// getCmd represents the get command
|
|
var getCmd = &cobra.Command{
|
|
Use: "get",
|
|
Short: "A brief description of your command",
|
|
Long: `A longer description that spans multiple lines and likely contains examples
|
|
and usage of using your command. For example:
|
|
|
|
Cobra is a CLI library for Go that empowers applications.
|
|
This application is a tool to generate the needed files
|
|
to quickly create a Cobra application.`,
|
|
Run: func(cmd *cobra.Command, args []string) {
|
|
fmt.Println("get called")
|
|
},
|
|
}
|
|
|
|
var (
|
|
albumURLLink string
|
|
downloadLocation string
|
|
)
|
|
|
|
func init() {
|
|
rootCmd.AddCommand(getCmd)
|
|
|
|
getCmd.Flags().StringVarP(&albumURLLink, "url", "u", "", "Bunkrr album url (required)")
|
|
getCmd.Flags().StringVarP(&downloadLocation, "location", "l", "./", "Download destination, it will create a folder inside of it with the album id")
|
|
getCmd.MarkFlagRequired("url")
|
|
|
|
}
|