Files
2026-03-20 20:04:21 +08:00

37 lines
554 B
Go

package main
import (
"fmt"
"os"
"github.com/spf13/cobra"
)
// Root Command
var rootCmd = &cobra.Command{
Use: "wonder",
Short: "Here we go",
Run: func(cmd *cobra.Command, args []string) {
fmt.Println("Here we go")
},
}
// Echo Command
var echoCmd = &cobra.Command{
Use: "girlfriend",
Run: func(cmd *cobra.Command, args []string) {
fmt.Println("I love my girlfriend")
},
}
// main
func main() {
// Add
rootCmd.AddCommand(echoCmd)
// Exec
if err := rootCmd.Execute(); err != nil {
fmt.Fprintln(os.Stderr, err)
os.Exit(1)
}
}