mirror of
https://github.com/fish-shell/fish-shell
synced 2024-12-26 04:43:10 +00:00
Use __fish_complete_user_at_hosts
for various completions. This makes the code a bit nicer, removes one of the __fish_print_hostnames calls (which are slow) and a sed call, thereby improving performance by about 33% (600ms to 400ms). Fixes #4511.
This commit is contained in:
parent
45fc499a91
commit
60248e895f
4 changed files with 4 additions and 37 deletions
|
@ -1,13 +1,5 @@
|
||||||
|
|
||||||
complete -x -c mosh -d Hostname -a "
|
complete -x -c mosh -d Hostname -a "(__fish_complete_user_at_hosts)"
|
||||||
|
|
||||||
(__fish_print_hostnames)
|
|
||||||
|
|
||||||
(
|
|
||||||
#Prepend any username specified in the completion to the hostname
|
|
||||||
echo (commandline -ct)|sed -ne 's/\(.*@\).*/\1/p'
|
|
||||||
)(__fish_print_hostnames)
|
|
||||||
"
|
|
||||||
|
|
||||||
complete -x -c mosh -d User -a "
|
complete -x -c mosh -d User -a "
|
||||||
(__fish_print_users)@
|
(__fish_print_users)@
|
||||||
|
|
|
@ -30,13 +30,7 @@ end
|
||||||
# Hostname
|
# Hostname
|
||||||
#
|
#
|
||||||
complete -c scp -d Hostname -n "commandline --cut-at-cursor --current-token | string match -v '*:*'" -a "
|
complete -c scp -d Hostname -n "commandline --cut-at-cursor --current-token | string match -v '*:*'" -a "
|
||||||
(__fish_print_hostnames):
|
(__fish_complete_user_at_hosts):"
|
||||||
|
|
||||||
(
|
|
||||||
#Prepend any username specified in the completion to the hostname
|
|
||||||
commandline -ct |sed -ne 's/\(.*@\).*/\1/p'
|
|
||||||
)(__fish_print_hostnames):
|
|
||||||
"
|
|
||||||
|
|
||||||
#
|
#
|
||||||
# Local path
|
# Local path
|
||||||
|
|
|
@ -6,14 +6,7 @@ __fish_complete_ssh ssh
|
||||||
#
|
#
|
||||||
# ssh specific completions
|
# ssh specific completions
|
||||||
#
|
#
|
||||||
complete -x -c ssh -d Hostname -a "
|
complete -x -c ssh -d Hostname -a "(__fish_complete_user_at_hosts)"
|
||||||
(__fish_print_hostnames)
|
|
||||||
|
|
||||||
(
|
|
||||||
# Prepend any username specified in the completion to the hostname
|
|
||||||
echo (commandline -ct)|sed -ne 's/\(.*@\).*/\1/p'
|
|
||||||
)(__fish_print_hostnames)
|
|
||||||
"
|
|
||||||
|
|
||||||
# Disable as username completion is not very useful.
|
# Disable as username completion is not very useful.
|
||||||
# complete -x -c ssh -d User -a "
|
# complete -x -c ssh -d User -a "
|
||||||
|
|
|
@ -1,19 +1,7 @@
|
||||||
#
|
#
|
||||||
# Completions for sshfs
|
# Completions for sshfs
|
||||||
#
|
#
|
||||||
# Host combinations, borrowed from ssh.fish
|
complete -x -c sshfs -d Hostname -a "(__fish_complete_user_at_hosts):"
|
||||||
#
|
|
||||||
complete -x -c sshfs -d Hostname -a "
|
|
||||||
|
|
||||||
(__fish_print_hostnames):
|
|
||||||
|
|
||||||
(
|
|
||||||
#Prepend any username specified in the completion to the hostname
|
|
||||||
echo (commandline -ct)|sed -ne 's/\(.*@\).*/\1/p'
|
|
||||||
)(__fish_print_hostnames):
|
|
||||||
|
|
||||||
(__fish_print_users)@
|
|
||||||
"
|
|
||||||
#
|
#
|
||||||
# Mount Points
|
# Mount Points
|
||||||
#
|
#
|
||||||
|
|
Loading…
Reference in a new issue