2005-09-20 21:31:55 +08:00
|
|
|
#
|
|
|
|
# Load common ssh options
|
|
|
|
#
|
|
|
|
|
2006-02-15 10:22:28 +08:00
|
|
|
__fish_complete_ssh scp
|
2005-09-20 21:31:55 +08:00
|
|
|
|
|
|
|
#
|
|
|
|
# scp specific completions
|
|
|
|
#
|
|
|
|
|
|
|
|
complete -c scp -d Hostname -a "
|
|
|
|
|
2013-09-19 23:19:13 +08:00
|
|
|
(__fish_print_hostnames):
|
2005-09-20 21:31:55 +08:00
|
|
|
|
|
|
|
(
|
|
|
|
#Prepend any username specified in the completion to the hostname
|
2013-05-21 12:45:54 +08:00
|
|
|
commandline -ct |sed -ne 's/\(.*@\).*/\1/p'
|
2013-09-19 23:19:13 +08:00
|
|
|
)(__fish_print_hostnames):
|
2005-09-20 21:31:55 +08:00
|
|
|
|
2012-12-07 11:55:23 +08:00
|
|
|
(__fish_print_users)@\tUsername
|
2005-09-20 21:31:55 +08:00
|
|
|
|
|
|
|
"
|
2012-07-12 08:20:58 +08:00
|
|
|
|
|
|
|
#
|
|
|
|
# Remote path
|
|
|
|
#
|
2015-09-10 02:55:04 +08:00
|
|
|
complete -c scp -d "Remote Path" -n "commandline -ct| __fish_sgrep -o '.*:'" -a "
|
2012-07-12 08:20:58 +08:00
|
|
|
|
|
|
|
(
|
|
|
|
#Prepend any user@host information supplied before the remote completion
|
2015-09-10 02:55:04 +08:00
|
|
|
commandline -ct| __fish_sgrep -o '.*:'
|
2012-07-12 08:20:58 +08:00
|
|
|
)(
|
|
|
|
#Get the list of remote files from the specified ssh server
|
2015-09-10 02:55:04 +08:00
|
|
|
ssh (commandline -c| __fish_sgrep -o '\-P [0-9]*'|tr P p) -o \"BatchMode yes\" (commandline -ct|sed -ne 's/\(.*\):.*/\1/p') ls\ -dp\ (commandline -ct|sed -ne 's/.*://p')\* 2> /dev/null
|
2012-07-12 08:20:58 +08:00
|
|
|
)
|
|
|
|
|
|
|
|
"
|
|
|
|
|
2007-01-16 09:18:28 +08: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-02 01:49:02 +08:00
|
|
|
complete -c scp -s S --description "Encryption program"
|
2005-09-20 21:31:55 +08:00
|
|
|
|