aboutsummaryrefslogtreecommitdiffhomepage
path: root/share/completions
diff options
context:
space:
mode:
authorGravatar Fabian Homborg <FHomborg@gmail.com>2015-12-17 12:35:16 +0100
committerGravatar Fabian Homborg <FHomborg@gmail.com>2015-12-17 12:35:16 +0100
commit5306fce16eec40e31386024b4e936ab94bf7bd8c (patch)
tree38602791a60f787cb814ca57276dceeb38105abc /share/completions
parentfb1a7d9d7355575cd38f7652411b6bfd02b0b924 (diff)
mount completions: Support spaces in mountpoints
This turns '\040' into a space. /etc/mtab also supports other escapes ("\\" for backslash, "\011" for tab), but I can't find documentation for those in fstab.
Diffstat (limited to 'share/completions')
-rw-r--r--share/completions/mount.fish4
1 files changed, 2 insertions, 2 deletions
diff --git a/share/completions/mount.fish b/share/completions/mount.fish
index cb945f8d..ba0d985f 100644
--- a/share/completions/mount.fish
+++ b/share/completions/mount.fish
@@ -10,8 +10,8 @@ end
complete -x -c mount -a '(__fish_complete_blockdevice)'
# In case `mount UUID=` and similar also works
-complete -x -c mount -a "(test -r /etc/fstab; and string replace -r '#.*' '' < /etc/fstab | string match -r '.+' | string replace -r ' ([^\s]*) .*' '\tMount point \$1')"
-complete -x -c mount -a "(test -r /etc/fstab; and string replace -r '#.*' '' < /etc/fstab | string match -r '.+' | string replace -r '(^[^\s]*) ([^\s]*) .*' '\$2\tDevice \$1')"
+complete -x -c mount -a "(test -r /etc/fstab; and string replace -r '#.*' '' < /etc/fstab | string match -r '.+' | string replace -r ' (\S*) .*' '\tMount point \$1' | string replace -a '\040' ' ')"
+complete -x -c mount -a "(test -r /etc/fstab; and string replace -r '#.*' '' < /etc/fstab | string match -r '.+' | string replace -r '(\S*) (\S*) .*' '\$2\tDevice \$1' | string replace -a '\040' ' ')"
# In case it doesn't
# complete -x -c mount -a "(test -r /etc/fstab; and string match -r '^/.*' < /etc/fstab | string replace -r ' ([^\s]*) .*' '\tMount point \$1')"
# complete -x -c mount -a "(test -r /etc/fstab; and string match -r '^/.*' < /etc/fstab | string replace -r '(^/[^\s]*) ([^\s]*) .*' '\$2\tDevice \$1')"