Skip to content

Commit 51fd3f3

Browse files
committed
--force flag for delete-artifact
1 parent 83d4b12 commit 51fd3f3

2 files changed

Lines changed: 7 additions & 0 deletions

File tree

cmd/hauler/cli/store.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -404,6 +404,7 @@ func addStoreDeleteArtifact(rso *flags.StoreRootOpts, ro *flags.CliRootOpts) *co
404404
return store.DeleteArtifactCmd(ctx, o, s, args[0])
405405
},
406406
}
407+
o.AddFlags(cmd)
407408

408409
return cmd
409410
}

internal/flags/delete-artifact.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
package flags
22

3+
import "github.com/spf13/cobra"
4+
35
type DeleteArtifactOpts struct {
46
Force bool // skip delete confirmation
57
}
8+
9+
func (o *DeleteArtifactOpts) AddFlags(cmd *cobra.Command) {
10+
cmd.Flags().BoolVarP(&o.Force, "force", "f", false, "(Optional) Delete artifacts without confirmation")
11+
}

0 commit comments

Comments
 (0)