mirror of
https://github.com/fish-shell/fish-shell
synced 2024-12-26 04:43:10 +00:00
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.
This commit is contained in:
parent
fb1a7d9d73
commit
5306fce16e
1 changed files with 2 additions and 2 deletions
|
@ -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')"
|
||||
|
|
Loading…
Reference in a new issue