From 775a85004fe6df9713c5fb3ed09bbb9850b153ce Mon Sep 17 00:00:00 2001 From: Matthew Heon Date: Fri, 30 May 2025 09:27:13 -0400 Subject: [PATCH] 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 --- docs/source/markdown/options/mount.md | 2 +- pkg/specgenutil/volumes.go | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/docs/source/markdown/options/mount.md b/docs/source/markdown/options/mount.md index 39dafa9304..0d298c61b4 100644 --- a/docs/source/markdown/options/mount.md +++ b/docs/source/markdown/options/mount.md @@ -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 diff --git a/pkg/specgenutil/volumes.go b/pkg/specgenutil/volumes.go index 7fa497c75b..02a7627a36 100644 --- a/pkg/specgenutil/volumes.go +++ b/pkg/specgenutil/volumes.go @@ -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) }