Fixed mount -o<TAB> exception

This commit is contained in:
ykai 2019-03-19 13:55:52 +08:00 committed by Fabian Homborg
parent 805a8db7ef
commit f56bce3f97

View file

@ -140,21 +140,22 @@ function __fish_complete_mount_opts
set -l token (commandline -tc | string replace -r '^-o' -- '')
set -l args (string split , -- $token)
set -l last_arg $args[-1]
set -e args[-1]
if test (count $args) -ne 0
set -l last_arg $args[-1]
set -e args[-1]
switch (string replace -r '=.*' '=' -- $last_arg)
case uid=
set -a fish_mount_opts uid=(__fish_print_user_ids)
case gid=
set -a fish_mount_opts gid=(__fish_print_group_ids)
case setuid=
set -a fish_mount_opts setuid=(__fish_print_user_ids)
case setgid=
set -a fish_mount_opts setgid=(__fish_print_group_ids)
switch (string replace -r '=.*' '=' -- $last_arg)
case uid=
set -a fish_mount_opts uid=(__fish_print_user_ids)
case gid=
set -a fish_mount_opts gid=(__fish_print_group_ids)
case setuid=
set -a fish_mount_opts setuid=(__fish_print_user_ids)
case setgid=
set -a fish_mount_opts setgid=(__fish_print_group_ids)
end
end
set -l prefix ''
if set -q args[1]
set prefix (string join , -- $args),