Skip to content

Commit

Permalink
fix(featctl/cmd): pass in revision-id
Browse files Browse the repository at this point in the history
  • Loading branch information
jinghancc committed Nov 12, 2021
1 parent fc58b8d commit 464b83d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
7 changes: 3 additions & 4 deletions featctl/cmd/get_historical_feature.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,6 @@ var getHistoricalFeatureCmd = &cobra.Command{
Use: "historical-feature",
Short: "get historical features in a group",
PreRun: func(cmd *cobra.Command, args []string) {
if !cmd.Flags().Changed("revision") {
getHistoricalFeatureOpt.Revision = nil
}
if !cmd.Flags().Changed("limit") {
getHistoricalFeatureOpt.Limit = nil
}
Expand Down Expand Up @@ -53,6 +50,8 @@ func init() {
flags.StringVarP(&getHistoricalFeatureOpt.groupName, "group", "g", "", "feature group name")
_ = getHistoricalFeatureCmd.MarkFlagRequired("group")

flags.Int32VarP(&getHistoricalFeatureOpt.RevisionID, "revision-id", "r", 0, "group revision id")
_ = getHistoricalFeatureCmd.MarkFlagRequired("revision-id")

getHistoricalFeatureOpt.Limit = flags.Uint64P("limit", "l", 0, "max records to export")
getHistoricalFeatureOpt.Revision = flags.Int64P("revision", "r", 0, "feature group revision")
}
4 changes: 2 additions & 2 deletions featctl/cmd/sync.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,6 @@ func init() {

flags := syncCmd.Flags()

flags.Int32VarP(&syncOpt.RevisionId, "revision", "r", 0, "group revision id")
_ = syncCmd.MarkFlagRequired("revision")
flags.Int32VarP(&syncOpt.RevisionId, "revision-id", "r", 0, "group revision id")
_ = syncCmd.MarkFlagRequired("revision-id")
}

0 comments on commit 464b83d

Please sign in to comment.