From 2583948f72a05cf38dc9f0c4ec1feef64ab9c9af Mon Sep 17 00:00:00 2001 From: Ed Santiago Date: Mon, 14 Sep 2020 15:19:34 -0600 Subject: Usability: prevent "-l" with arguments Add new system check confirming that "podman foo -l arg" throws an error; and fix lots of instances where code was not doing this check. I'll probably need to add something similar for --all but that can wait. Signed-off-by: Ed Santiago --- cmd/podman/pods/inspect.go | 3 +++ 1 file changed, 3 insertions(+) (limited to 'cmd/podman/pods') diff --git a/cmd/podman/pods/inspect.go b/cmd/podman/pods/inspect.go index 8f5aa6062..bc20352b0 100644 --- a/cmd/podman/pods/inspect.go +++ b/cmd/podman/pods/inspect.go @@ -46,6 +46,9 @@ func inspect(cmd *cobra.Command, args []string) error { if len(args) < 1 && !inspectOptions.Latest { return errors.Errorf("you must provide the name or id of a running pod") } + if len(args) > 0 && inspectOptions.Latest { + return errors.Errorf("--latest and containers cannot be used together") + } if !inspectOptions.Latest { inspectOptions.NameOrID = args[0] -- cgit v1.2.3-54-g00ecf