mirror of
https://github.com/fish-shell/fish-shell
synced 2024-11-11 23:47:25 +00:00
scp completions: use __fish_print_hostnames rather than doing independent hostname searches
This commit is contained in:
parent
c2dcfc9176
commit
3d68d1bbe2
1 changed files with 2 additions and 7 deletions
|
@ -10,17 +10,12 @@ __fish_complete_ssh scp
|
|||
|
||||
complete -c scp -d Hostname -a "
|
||||
|
||||
(
|
||||
#Find a suitable hostname from the knownhosts files
|
||||
cat ~/.ssh/known_hosts{,2} ^/dev/null|cut -d ' ' -f 1| cut -d , -f 1
|
||||
):
|
||||
(__fish_print_hostnames):
|
||||
|
||||
(
|
||||
#Prepend any username specified in the completion to the hostname
|
||||
commandline -ct |sed -ne 's/\(.*@\).*/\1/p'
|
||||
)(
|
||||
cat ~/.ssh/known_hosts{,2} ^/dev/null|cut -d ' ' -f 1| cut -d , -f 1
|
||||
):
|
||||
)(__fish_print_hostnames):
|
||||
|
||||
(__fish_print_users)@\tUsername
|
||||
|
||||
|
|
Loading…
Reference in a new issue