Skip to content

Commit 824e813

Browse files
committed
Mark active context
1 parent 780dcaf commit 824e813

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

cmd/config.go

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,9 +82,13 @@ var configContextCmd = &cobra.Command{
8282
Args: cobra.NoArgs,
8383
Run: func(cmd *cobra.Command, args []string) {
8484
tw := ansiterm.NewTabWriter(os.Stdout, 6, 0, 1, ' ', 0)
85-
fmt.Fprintln(tw, "NAME\tENDPOINT\tPROJECT")
85+
fmt.Fprintln(tw, "ACTIVE\tNAME\tENDPOINT\tPROJECT")
8686
for name, ctx := range globalConfiguration.Contexts {
87-
fmt.Fprintf(tw, "%s\t%s\t%s\n", name, ctx.Endpoint, ctx.Project)
87+
active := ""
88+
if name == globalConfiguration.ActiveContext {
89+
active = "*"
90+
}
91+
fmt.Fprintf(tw, "%s\t%s\t%s\t%s\n", active, name, ctx.Endpoint, ctx.Project)
8892
}
8993
tw.Flush()
9094
},

0 commit comments

Comments
 (0)