awesome-cli/cli/cmd/cli.go

30 lines
445 B
Go
Raw Normal View History

2025-10-16 12:46:23 +03:00
package cmd
import (
"os"
"github.com/spf13/cobra"
)
var (
RootCmd = &cobra.Command{
Use: "acli",
Short: "Интерфейс командной строки",
CompletionOptions: cobra.CompletionOptions{
HiddenDefaultCmd: true,
},
Run: func(cmd *cobra.Command, args []string) {
if len(args) == 0 {
cmd.Help()
os.Exit(0)
}
},
}
)
func Execute() {
if err := RootCmd.Execute(); err != nil {
panic(err)
}
}