Skip to content

Commit

Permalink
declare --volume as an alias for --volumes
Browse files Browse the repository at this point in the history
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
  • Loading branch information
ndeloof committed Feb 18, 2022
1 parent fb9310c commit 61b30f0
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions cmd/compose/down.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,9 @@ import (
"time"

"github.com/compose-spec/compose-go/types"
"github.com/sirupsen/logrus"
"github.com/spf13/cobra"
"github.com/spf13/pflag"

"github.com/docker/compose/v2/pkg/api"
)
Expand Down Expand Up @@ -62,6 +64,14 @@ func downCommand(p *projectOptions, backend api.Service) *cobra.Command {
flags.IntVarP(&opts.timeout, "timeout", "t", 10, "Specify a shutdown timeout in seconds")
flags.BoolVarP(&opts.volumes, "volumes", "v", false, " Remove named volumes declared in the `volumes` section of the Compose file and anonymous volumes attached to containers.")
flags.StringVar(&opts.images, "rmi", "", `Remove images used by services. "local" remove only images that don't have a custom tag ("local"|"all")`)
flags.SetNormalizeFunc(func(f *pflag.FlagSet, name string) pflag.NormalizedName {
switch name {
case "volume":
name = "volumes"
logrus.Warn("--volume is deprecated, please use --volumes")
}
return pflag.NormalizedName(name)
})
return downCmd
}

Expand Down

0 comments on commit 61b30f0

Please sign in to comment.