Skip to content

Commit

Permalink
feat(featctl/cmd): add parameter revision for command import
Browse files Browse the repository at this point in the history
  • Loading branch information
jinghancc committed Nov 8, 2021
1 parent 456efd0 commit 5bde98d
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions featctl/cmd/import.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,11 @@ var importOpt importOption
var importCmd = &cobra.Command{
Use: "import",
Short: "import feature data from a csv file",
PreRun: func(cmd *cobra.Command, args []string) {
if !cmd.Flags().Changed("revision") {
importOpt.Revision = nil
}
},
Run: func(cmd *cobra.Command, args []string) {
ctx := context.Background()
oomStore := mustOpenOomStore(ctx, oomStoreCfg)
Expand Down Expand Up @@ -54,5 +59,7 @@ func init() {

flags.StringVar(&importOpt.FilePath, "input-file", "", "input csv file")
_ = importCmd.MarkFlagRequired("input-file")

flags.StringVar(&importOpt.DataSource.Delimiter, "delimiter", ",", "specify field delimiter")
importOpt.Revision = flags.Int64P("revision", "r", 0, "user-defined revision")
}

0 comments on commit 5bde98d

Please sign in to comment.