Skip to content

Commit

Permalink
Add an overwrite flag to "package bind"
Browse files Browse the repository at this point in the history
  • Loading branch information
jiangpengcheng committed Apr 2, 2020
1 parent c5daef0 commit 62b1573
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
1 change: 1 addition & 0 deletions commands/flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ type FlagsStruct struct {
detail bool
format string
nameSort bool // sorts list alphabetically by entity name
overwrite bool
}

property struct {
Expand Down
5 changes: 4 additions & 1 deletion commands/package.go
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,9 @@ var packageBindCmd = &cobra.Command{
Binding: binding,
}

_, _, err = Client.Packages.Insert(p, false)
overwrite := Flags.common.overwrite

_, _, err = Client.Packages.Insert(p, overwrite)
if err != nil {
whisk.Debug(whisk.DbgError, "Client.Packages.Insert(%#v, false) failed: %s\n", p, err)
errStr := wski18n.T("Binding creation failed: {{.err}}", map[string]interface{}{"err": err})
Expand Down Expand Up @@ -522,6 +524,7 @@ func init() {
packageBindCmd.Flags().StringVarP(&Flags.common.annotFile, "annotation-file", "A", "", wski18n.T("`FILE` containing annotation values in JSON format"))
packageBindCmd.Flags().StringSliceVarP(&Flags.common.param, "param", "p", []string{}, wski18n.T("parameter values in `KEY VALUE` format"))
packageBindCmd.Flags().StringVarP(&Flags.common.paramFile, "param-file", "P", "", wski18n.T("`FILE` containing parameter values in JSON format"))
packageBindCmd.Flags().BoolVarP(&Flags.common.overwrite, "overwrite", "o", false, wski18n.T("overwrite bind"))

packageListCmd.Flags().IntVarP(&Flags.common.skip, "skip", "s", 0, wski18n.T("exclude the first `SKIP` number of packages from the result"))
packageListCmd.Flags().IntVarP(&Flags.common.limit, "limit", "l", 30, wski18n.T("only return `LIMIT` number of packages from the collection"))
Expand Down

0 comments on commit 62b1573

Please sign in to comment.