yufan.me/tools/cmd/root.go

24 lines
404 B
Go
Raw Normal View History

2024-06-14 02:13:47 +08:00
package cmd
import (
"github.com/spf13/cobra"
"os"
)
// rootCmd represents the base command when called without any subcommands
var rootCmd = &cobra.Command{
Use: "tools",
Short: "A set of useful tools for writing in weblog",
}
func Execute() {
err := rootCmd.Execute()
if err != nil {
os.Exit(1)
}
}
func init() {
rootCmd.Flags().BoolP("toggle", "t", false, "Help message for toggle")
}