Skip to content

Commit

Permalink
feat(featctl): add featctl command describe group
Browse files Browse the repository at this point in the history
  • Loading branch information
jinghancc committed Oct 18, 2021
1 parent 5e41255 commit 599ec97
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions featctl/cmd/describe_group.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
package cmd

import (
"context"
"fmt"
"log"

"github.com/spf13/cobra"
)

var describeGroupCmd = &cobra.Command{
Use: "group",
Short: "show details of a specific group",
Args: cobra.ExactArgs(1),
Run: func(cmd *cobra.Command, args []string) {
ctx := context.Background()
oneStore := mustOpenOneStore(ctx, oneStoreOpt)
groupName := args[0]
group, err := oneStore.GetFeatureGroup(ctx, groupName)
if err != nil {
log.Fatalf("failed getting group %s, err %v\n", groupName, err)
}
fmt.Println(group.String())
},
}

func init() {
describeCmd.AddCommand(describeGroupCmd)
}

0 comments on commit 599ec97

Please sign in to comment.