-
Notifications
You must be signed in to change notification settings - Fork 2
/
root.go
42 lines (36 loc) · 1.49 KB
/
root.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
package cmd
import (
"github.com/gookit/color"
"github.com/spf13/cobra"
)
const logo = `
________ .__ .__
/ _____/ ____ ______ | |__ ___________|__|_______ ____
/ \ ___ / _ \\____ \| | \_/ __ \_ __ \ \___ // __ \
\ \_\ ( <_> ) |_> > Y \ ___/| | \/ |/ /\ ___/
\______ /\____/| __/|___| /\___ >__| |__/_____ \\___ >
\/ |__| \/ \/ \/ \/
`
const description = `
Thank you for installing gopherize!!
Welcome to Gopherize, your go-to resource for learning Go! This CLI will guide you through
a series of exercises designed to teach you the fundamentals of Go programming. Each exercise
is designed to be simple and easy to follow, even if you're a complete beginner.You'll
start by learning the basics of the language and then gradually move on to more advanced topics.
By the time you've completed all the exercises, you'll have a solid foundation in Go and be
ready to tackle more complex projects. So let's get started and Gopherize your coding skills!
`
func Root() *cobra.Command {
b := color.FgBlue.Render
var rootCmd = &cobra.Command{
Use: "gopherize <command>",
Short: "Let's gopherize you into gopher!",
Long: b(logo) + "\n" + description,
}
// Disable completion
rootCmd.CompletionOptions.DisableDefaultCmd = true
rootCmd.AddCommand(runCmd())
rootCmd.AddCommand(verifyCmd())
rootCmd.AddCommand(watchCmd())
return rootCmd
}