Skip to content

Commit

Permalink
refactor(featctl): fix featctl command join
Browse files Browse the repository at this point in the history
  • Loading branch information
jinghancc committed Nov 18, 2021
1 parent ff6f68e commit 23c9a52
Showing 1 changed file with 2 additions and 9 deletions.
11 changes: 2 additions & 9 deletions featctl/cmd/import.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@ import (

type importOption struct {
types.ImportOpt
FilePath string
groupName string
FilePath string
}

var importOpt importOption
Expand All @@ -31,12 +30,6 @@ var importCmd = &cobra.Command{
oomStore := mustOpenOomStore(ctx, oomStoreCfg)
defer oomStore.Close()

if group, err := oomStore.GetGroupByName(ctx, importOpt.groupName); err != nil {
log.Fatalf("failed to get feature group name=%s: %v", importOpt.groupName, err)
} else {
importOpt.GroupID = group.ID
}

file, err := os.Open(importOpt.FilePath)
if err != nil {
log.Fatalf("read file %s failed: %v", importOpt.FilePath, err)
Expand All @@ -60,7 +53,7 @@ func init() {

flags := importCmd.Flags()

flags.StringVarP(&importOpt.groupName, "group", "g", "", "feature group")
flags.StringVarP(&importOpt.GroupName, "group", "g", "", "feature group")
_ = importCmd.MarkFlagRequired("group")

flags.StringVar(&importOpt.Description, "description", "", "revision description")
Expand Down

0 comments on commit 23c9a52

Please sign in to comment.