mirror of
https://github.com/fish-shell/fish-shell.git
synced 2024-11-29 13:23:53 +08:00
Fix echo "no wildcard match" complaints for ssh completions etc
This commit is contained in:
parent
5b3904e66b
commit
2b4f61f294
|
@ -59,17 +59,23 @@ function __fish_print_hostnames -d "Print a list of known hostnames"
|
||||||
# Normalize whitespace
|
# Normalize whitespace
|
||||||
| string trim | string replace -r -a '\s+' ' ')
|
| string trim | string replace -r -a '\s+' ' ')
|
||||||
end
|
end
|
||||||
if test -n "$paths"
|
|
||||||
# Expand paths which may have globbing and tokenize
|
set -l new_paths
|
||||||
set paths (eval "echo $paths" | string split ' ')
|
for path in $paths
|
||||||
for path_index in (seq (count $paths))
|
set -l expanded_path
|
||||||
# Resolve relative paths
|
eval set expanded_path (echo $path)
|
||||||
if string match -v '/*' $paths[$path_index] >/dev/null
|
for path in $expanded_path
|
||||||
set paths[$path_index] $relative_path/$paths[$path_index]
|
# Resolve "relative" paths in accordance to ssh path resolution
|
||||||
|
if string match -qv '/*' $path
|
||||||
|
set path $relative_path/$path
|
||||||
end
|
end
|
||||||
echo $paths[$path_index]
|
echo $path
|
||||||
|
set new_paths $new_paths $path
|
||||||
end
|
end
|
||||||
_recursive $paths
|
end
|
||||||
|
|
||||||
|
if test -n "$new_paths";
|
||||||
|
_recursive $new_paths
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
_recursive $ssh_config
|
_recursive $ssh_config
|
||||||
|
|
Loading…
Reference in New Issue
Block a user