2005-09-20 13:31:55 +00:00
|
|
|
#
|
|
|
|
# Load common ssh options
|
|
|
|
#
|
|
|
|
|
2006-02-15 02:22:28 +00:00
|
|
|
__fish_complete_ssh scp
|
2005-09-20 13:31:55 +00:00
|
|
|
|
|
|
|
#
|
|
|
|
# scp specific completions
|
|
|
|
#
|
|
|
|
|
|
|
|
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
|
|
|
|
):
|
|
|
|
|
|
|
|
(
|
|
|
|
#Prepend any username specified in the completion to the hostname
|
2005-12-18 22:51:50 +00:00
|
|
|
echo (commandline -ct)|sed -ne 's/\(.*@\).*/\1/p'
|
2005-09-20 13:31:55 +00:00
|
|
|
)(
|
|
|
|
cat ~/.ssh/known_hosts{,2} ^/dev/null|cut -d ' ' -f 1| cut -d , -f 1
|
|
|
|
):
|
|
|
|
|
2012-12-07 03:55:23 +00:00
|
|
|
(__fish_print_users)@\tUsername
|
2005-09-20 13:31:55 +00:00
|
|
|
|
|
|
|
"
|
2012-07-12 00:20:58 +00:00
|
|
|
|
|
|
|
#
|
|
|
|
# Remote path
|
|
|
|
#
|
|
|
|
complete -c scp -d "Remote Path" -n "echo (commandline -ct)|sgrep -o '.*:';and true" -a "
|
|
|
|
|
|
|
|
(
|
|
|
|
#Prepend any user@host information supplied before the remote completion
|
|
|
|
echo (commandline -ct)|sgrep -o '.*:'
|
|
|
|
)(
|
|
|
|
#Get the list of remote files from the specified ssh server
|
2013-04-17 11:45:42 +00:00
|
|
|
ssh -o \"BatchMode yes\" (echo (commandline -ct)|sed -ne 's/\(.*\):.*/\1/p') ls\ -dp\ (echo (commandline -ct)|sed -ne 's/.*://p')\*
|
2012-07-12 00:20:58 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
"
|
|
|
|
|
2007-01-16 01:18:28 +00:00
|
|
|
complete -c scp -s B --description "Batch mode"
|
|
|
|
complete -c scp -s l -x --description "Bandwidth limit"
|
|
|
|
complete -c scp -s P -x --description "Port"
|
|
|
|
complete -c scp -s p --description "Preserves modification times, access times, and modes from the original file"
|
|
|
|
complete -c scp -s q --description "Do not display progress bar"
|
|
|
|
complete -c scp -s r --description "Recursively copy"
|
2013-04-01 17:49:02 +00:00
|
|
|
complete -c scp -s S --description "Encryption program"
|
2005-09-20 13:31:55 +00:00
|
|
|
|