2025-02-08 12:00:16 +03:00

35 lines
734 B
Go

package cmd
import (
"fmt"
"os"
"runtime"
"github.com/spf13/cobra"
)
var rootCmd = &cobra.Command{
Use: "train",
Short: "Train - Лёгкий пакетный менеджер",
PersistentPreRun: func(cmd *cobra.Command, args []string) {
if runtime.GOOS == "windows" {
fmt.Println("[WARNING] Train работает на Windows в режиме совместимости. Гарантий работы нет.")
}
},
}
func Execute() {
if err := rootCmd.Execute(); err != nil {
fmt.Println(err)
os.Exit(1)
}
}
func init() {
rootCmd.AddCommand(installCmd)
rootCmd.AddCommand(removeCmd)
rootCmd.AddCommand(updateCmd)
rootCmd.AddCommand(listCmd)
rootCmd.AddCommand(infoCmd)
rootCmd.AddCommand(repoCmd)
}