train-osource/cmd/info.go
wheelchairy b6ea0e0f59 upd2
2025-02-04 18:30:33 +03:00

22 lines
542 B
Go
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

package cmd
import (
"fmt"
"train/pkg/installer"
"github.com/spf13/cobra"
)
var infoCmd = &cobra.Command{
Use: "info [package]",
Short: "Выводит информацию о пакете",
Args: cobra.ExactArgs(1),
Run: func(cmd *cobra.Command, args []string) {
pkgName := args[0]
info, err := installer.GetPackageInfo(pkgName)
if err != nil {
fmt.Printf("Ошибка получения информации: %v\n", err)
return
}
fmt.Printf("Информация о пакете %s:\n%s\n", pkgName, info)
},
}