mirror of
https://github.com/sern-handler/cli
synced 2026-06-25 09:12:21 +00:00
29 lines
566 B
Go
29 lines
566 B
Go
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)
|
|
}
|
|
}
|