aboutsummaryrefslogtreecommitdiff
path: root/cmd/podman/volumes
diff options
context:
space:
mode:
authorDaniel J Walsh <dwalsh@redhat.com>2022-05-23 18:10:08 -0400
committerDaniel J Walsh <dwalsh@redhat.com>2022-05-24 13:17:02 -0400
commitdf394b5218dc3078f2d5f9ed83ca6e4f92e738c8 (patch)
tree8cf70a04db0b6cfc177f922efb1ab72c89326f97 /cmd/podman/volumes
parent2dc4f752c67e8e8c1035d6e2d689779cdc00004b (diff)
downloadpodman-df394b5218dc3078f2d5f9ed83ca6e4f92e738c8.tar.gz
podman-df394b5218dc3078f2d5f9ed83ca6e4f92e738c8.tar.bz2
podman-df394b5218dc3078f2d5f9ed83ca6e4f92e738c8.zip
Allow podman pod create to accept name argument
I am constantly attempting to add the podname to the last argument to podman pod create. Allowing this makes it match podman volume create and podman network create. It does not match podman container create, since podman container create arguments specify the arguments to run with the container. Still need to support the --name option for backwards compatibility. Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
Diffstat (limited to 'cmd/podman/volumes')
-rw-r--r--cmd/podman/volumes/create.go4
1 files changed, 1 insertions, 3 deletions
diff --git a/cmd/podman/volumes/create.go b/cmd/podman/volumes/create.go
index 1668c72de..b47ae16ce 100644
--- a/cmd/podman/volumes/create.go
+++ b/cmd/podman/volumes/create.go
@@ -17,6 +17,7 @@ var (
createCommand = &cobra.Command{
Use: "create [options] [NAME]",
+ Args: cobra.MaximumNArgs(1),
Short: "Create a new volume",
Long: createDescription,
RunE: create,
@@ -59,9 +60,6 @@ func create(cmd *cobra.Command, args []string) error {
var (
err error
)
- if len(args) > 1 {
- return errors.Errorf("too many arguments, create takes at most 1 argument")
- }
if len(args) > 0 {
createOpts.Name = args[0]
}