summaryrefslogtreecommitdiff
path: root/cmd/podman
diff options
context:
space:
mode:
Diffstat (limited to 'cmd/podman')
-rw-r--r--cmd/podman/common/volumes.go4
-rw-r--r--cmd/podman/validate/args.go7
2 files changed, 8 insertions, 3 deletions
diff --git a/cmd/podman/common/volumes.go b/cmd/podman/common/volumes.go
index aff323936..883d604da 100644
--- a/cmd/podman/common/volumes.go
+++ b/cmd/podman/common/volumes.go
@@ -337,9 +337,9 @@ func getBindMount(args []string) (spec.Mount, error) {
}
switch kv[1] {
case "private":
- newMount.Options = append(newMount.Options, "z")
- case "shared":
newMount.Options = append(newMount.Options, "Z")
+ case "shared":
+ newMount.Options = append(newMount.Options, "z")
default:
return newMount, errors.Wrapf(util.ErrBadMntOption, "%s mount option must be 'private' or 'shared'", kv[0])
}
diff --git a/cmd/podman/validate/args.go b/cmd/podman/validate/args.go
index c00813369..fc07a6acc 100644
--- a/cmd/podman/validate/args.go
+++ b/cmd/podman/validate/args.go
@@ -3,6 +3,7 @@ package validate
import (
"fmt"
"strconv"
+ "strings"
"github.com/containers/podman/v3/cmd/podman/registry"
"github.com/pkg/errors"
@@ -20,7 +21,11 @@ func NoArgs(cmd *cobra.Command, args []string) error {
// SubCommandExists returns an error if no sub command is provided
func SubCommandExists(cmd *cobra.Command, args []string) error {
if len(args) > 0 {
- return errors.Errorf("unrecognized command `%[1]s %[2]s`\nTry '%[1]s --help' for more information.", cmd.CommandPath(), args[0])
+ suggestions := cmd.SuggestionsFor(args[0])
+ if len(suggestions) == 0 {
+ return errors.Errorf("unrecognized command `%[1]s %[2]s`\nTry '%[1]s --help' for more information.", cmd.CommandPath(), args[0])
+ }
+ return errors.Errorf("unrecognized command `%[1]s %[2]s`\n\nDid you mean this?\n\t%[3]s\n\nTry '%[1]s --help' for more information.", cmd.CommandPath(), args[0], strings.Join(suggestions, "\n\t"))
}
return errors.Errorf("missing command '%[1]s COMMAND'\nTry '%[1]s --help' for more information.", cmd.CommandPath())
}