mirror of https://github.com/containers/podman.git
Add "dest" as an alias for "destination" in `--mount`
Given I wrote this and I still mess it up on a regular basis, I cannot be alone in forgetting whether "dst" or "dest" is the correct short option for "destination". Let's just make both valid, I don't see a reason not to. Signed-off-by: Matthew Heon <matthew.heon@pm.me>
This commit is contained in:
parent
23ded8bcee
commit
775a85004f
|
@ -13,7 +13,7 @@ Options common to all mount types:
|
|||
- *src*, *source*: mount source spec for **bind**, **glob**, and **volume**.
|
||||
Mandatory for **artifact**, **bind**, **glob**, **image** and **volume**.
|
||||
|
||||
- *dst*, *destination*, *target*: mount destination spec.
|
||||
- *dst*, *dest*, *destination*, *target*: mount destination spec.
|
||||
|
||||
When source globs are specified without the destination directory,
|
||||
the files and directories are mounted with their complete path
|
||||
|
|
|
@ -446,7 +446,7 @@ func parseMountOptions(mountType string, args []string) (*universalMount, error)
|
|||
return nil, fmt.Errorf("%v: %w", name, errOptionArg)
|
||||
}
|
||||
mnt.subPath = value
|
||||
case "target", "dst", "destination":
|
||||
case "target", "dst", "dest", "destination":
|
||||
if mnt.mount.Destination != "" {
|
||||
return nil, fmt.Errorf("cannot pass %q option more than once: %w", name, errOptionArg)
|
||||
}
|
||||
|
@ -617,7 +617,7 @@ func getDevptsMount(args []string) (spec.Mount, error) {
|
|||
switch name {
|
||||
case "uid", "gid", "mode", "ptmxmode", "newinstance", "max":
|
||||
newMount.Options = append(newMount.Options, arg)
|
||||
case "target", "dst", "destination":
|
||||
case "target", "dst", "dest", "destination":
|
||||
if !hasValue {
|
||||
return newMount, fmt.Errorf("%v: %w", name, errOptionArg)
|
||||
}
|
||||
|
@ -674,7 +674,7 @@ func getImageVolume(args []string) (*specgen.ImageVolume, error) {
|
|||
return nil, fmt.Errorf("%v: %w", name, errOptionArg)
|
||||
}
|
||||
newVolume.Source = value
|
||||
case "target", "dst", "destination":
|
||||
case "target", "dst", "dest", "destination":
|
||||
if !hasValue {
|
||||
return nil, fmt.Errorf("%v: %w", name, errOptionArg)
|
||||
}
|
||||
|
@ -728,7 +728,7 @@ func getArtifactVolume(args []string) (*specgen.ArtifactVolume, error) {
|
|||
return nil, fmt.Errorf("%v: %w", name, errOptionArg)
|
||||
}
|
||||
newVolume.Source = value
|
||||
case "target", "dst", "destination":
|
||||
case "target", "dst", "dest", "destination":
|
||||
if !hasValue {
|
||||
return nil, fmt.Errorf("%v: %w", name, errOptionArg)
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue