31 lines
555 B
Go
31 lines
555 B
Go
package cmd
|
|
|
|
import (
|
|
"fmt"
|
|
"os"
|
|
|
|
"github.com/spf13/cobra"
|
|
)
|
|
|
|
var rootCmd = &cobra.Command{
|
|
Use: "cdglab",
|
|
Short: "cdglab is a tool for gitlab CI-CD.",
|
|
Long: `cdglab is a basic tool for Gitlab CI/CD, used to encapsulate a series of RESTful API calls.`,
|
|
Run: func(cmd *cobra.Command, args []string) {
|
|
fmt.Println("Execute the command cdglab -h to view the usage method.")
|
|
},
|
|
}
|
|
|
|
func init() {
|
|
rootCmd.AddCommand()
|
|
rootCmd.AddCommand(rawCmd)
|
|
|
|
}
|
|
|
|
func Execute() {
|
|
if err := rootCmd.Execute(); err != nil {
|
|
fmt.Println(err)
|
|
os.Exit(1)
|
|
}
|
|
}
|