Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion cmd/prune.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ var pruneCmd = &cobra.Command{

// init initializes prune command.
func init() {
flags := rmCmd.Flags()
flags := pruneCmd.Flags()
flags.BoolVar(&pruneConfig.DryRun, "dry-run", false, "do not remove any blobs, just print what would be removed")
flags.BoolVar(&pruneConfig.RemoveUntagged, "remove-untagged", true, "remove untagged manifests")

Expand Down
2 changes: 1 addition & 1 deletion cmd/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ var versionCmd = &cobra.Command{

// init initializes version command.
func init() {
flags := rmCmd.Flags()
flags := versionCmd.Flags()

if err := viper.BindPFlags(flags); err != nil {
panic(fmt.Errorf("bind version flags to viper: %w", err))
Comment on lines +42 to 45

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Since the version command has no flags defined, versionCmd.Flags() returns an empty flag set. The subsequent call to viper.BindPFlags is therefore a no-op. This block of code is redundant. For better code clarity, consider removing the entire init function as it currently has no effect.

Expand Down
Loading