Files
yutu/cmd/root.go
T
2024-02-22 23:59:22 +08:00

34 lines
546 B
Go

package cmd
import (
"os"
"github.com/spf13/cobra"
"github.com/spf13/viper"
)
var RootCmd = &cobra.Command{
Use: "yutu",
Short: "A fully functional CLI for YouTube",
Long: "yutu is a fully functional CLI for YouTube, which can be used to manupulate YouTube videos, playlists, channels, etc.",
Run: func(cmd *cobra.Command, args []string) {
cmd.Help()
},
}
func Execute() {
err := RootCmd.Execute()
if err != nil {
os.Exit(1)
}
}
func init() {
cobra.OnInitialize(initConfig)
}
func initConfig() {
viper.AutomaticEnv()
}