Skip to content

Commit

Permalink
add config current-context command
Browse files Browse the repository at this point in the history
  • Loading branch information
birdayz committed Apr 3, 2020
1 parent 92b0532 commit f8ea236
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions cmd/kaf/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ func init() {
configCmd.AddCommand(configLsCmd)
configCmd.AddCommand(configAddClusterCmd)
configCmd.AddCommand(configSelectCluster)
configCmd.AddCommand(configCurrentContext)
rootCmd.AddCommand(configCmd)

configLsCmd.Flags().BoolVar(&noHeaderFlag, "no-headers", false, "Hide table headers")
Expand All @@ -25,6 +26,15 @@ var configCmd = &cobra.Command{
Short: "Handle kaf configuration",
}

var configCurrentContext = &cobra.Command{
Use: "current-context",
Short: "Displays the current context",
Args: cobra.ExactArgs(0),
Run: func(cmd *cobra.Command, args []string) {
fmt.Println(cfg.CurrentCluster)
},
}

var configUseCmd = &cobra.Command{
Use: "use-cluster [NAME]",
Short: "Sets the current cluster in the configuration",
Expand Down

0 comments on commit f8ea236

Please sign in to comment.