mirror of
https://github.com/psviderski/uncloud.git
synced 2026-11-10 12:44:16 +00:00
28 lines
501 B
Go
28 lines
501 B
Go
package context
|
|
|
|
import (
|
|
"fmt"
|
|
|
|
"github.com/psviderski/uncloud/internal/cli"
|
|
"github.com/spf13/cobra"
|
|
)
|
|
|
|
func NewShowCommand() *cobra.Command {
|
|
cmd := &cobra.Command{
|
|
Use: "show",
|
|
Short: "Show current cluster context.",
|
|
Args: cobra.NoArgs,
|
|
RunE: func(cmd *cobra.Command, args []string) error {
|
|
uncli := cmd.Context().Value("cli").(*cli.CLI)
|
|
return show(uncli)
|
|
},
|
|
}
|
|
|
|
return cmd
|
|
}
|
|
|
|
func show(uncli *cli.CLI) error {
|
|
fmt.Println(uncli.ContextOverrideOrCurrent())
|
|
return nil
|
|
}
|