From df394b5218dc3078f2d5f9ed83ca6e4f92e738c8 Mon Sep 17 00:00:00 2001 From: Daniel J Walsh Date: Mon, 23 May 2022 18:10:08 -0400 Subject: 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 --- cmd/podman/volumes/create.go | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'cmd/podman/volumes') 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] } -- cgit v1.2.3-54-g00ecf