feat(go): start rewrite in go

This commit is contained in:
Allyedge
2022-05-29 19:55:20 +02:00
parent 765771f759
commit 321b537a4d
19 changed files with 102 additions and 8709 deletions

28
cmd/cli/root.go Normal file
View File

@@ -0,0 +1,28 @@
package cli
import (
"fmt"
"os"
"github.com/spf13/cobra"
)
var rootCmd = &cobra.Command{
Use: "sern",
Short: "A powerful CLI tool for Sern.",
Version: "0.1.0",
Run: func(cmd *cobra.Command, args []string) {
fmt.Println("Sern CLI")
},
}
func Execute() {
rootCmd.Flags().BoolP("help", "h", false, "Help for the Sern CLI.")
rootCmd.Flags().BoolP("version", "v", false, "The version of the Sern CLI.")
rootCmd.SetVersionTemplate("Sern CLI - Version {{.Version}}\n")
if err := rootCmd.Execute(); err != nil {
fmt.Println(err)
os.Exit(1)
}
}