2005-09-20 13:31:55 +00:00
|
|
|
#
|
2017-02-02 06:49:40 +00:00
|
|
|
# Load completions shared by ssh and scp.
|
2005-09-20 13:31:55 +00:00
|
|
|
#
|
2006-02-15 02:22:28 +00:00
|
|
|
__fish_complete_ssh scp
|
2005-09-20 13:31:55 +00:00
|
|
|
|
|
|
|
#
|
|
|
|
# scp specific completions
|
|
|
|
#
|
|
|
|
|
2017-01-26 02:03:36 +00:00
|
|
|
#
|
|
|
|
# Hostname
|
|
|
|
#
|
2017-02-02 06:49:40 +00:00
|
|
|
complete -c scp -d Hostname -n "commandline --cut-at-cursor --current-token | string match -v '*:*'" -a "
|
2005-09-20 13:31:55 +00:00
|
|
|
|
2013-09-19 15:19:13 +00:00
|
|
|
(__fish_print_hostnames):
|
2005-09-20 13:31:55 +00:00
|
|
|
|
|
|
|
(
|
|
|
|
#Prepend any username specified in the completion to the hostname
|
2013-05-21 04:45:54 +00:00
|
|
|
commandline -ct |sed -ne 's/\(.*@\).*/\1/p'
|
2013-09-19 15:19:13 +00:00
|
|
|
)(__fish_print_hostnames):
|
2005-09-20 13:31:55 +00:00
|
|
|
"
|
2012-07-12 00:20:58 +00:00
|
|
|
|
2017-01-26 02:03:36 +00:00
|
|
|
#
|
|
|
|
# Local path
|
|
|
|
#
|
2017-02-02 06:49:40 +00:00
|
|
|
complete -c scp -d "Local Path" -n "commandline -ct | string match ':'"
|
2017-01-26 02:03:36 +00:00
|
|
|
|
2012-07-12 00:20:58 +00:00
|
|
|
#
|
|
|
|
# Remote path
|
|
|
|
#
|
2017-02-02 06:49:40 +00:00
|
|
|
complete -c scp -d "Remote Path" -f -n "commandline --cut-at-cursor --current-token | string match -r '.+:'" -a "
|
2012-07-12 00:20:58 +00:00
|
|
|
|
|
|
|
(
|
|
|
|
#Prepend any user@host information supplied before the remote completion
|
2015-09-09 18:55:04 +00:00
|
|
|
commandline -ct| __fish_sgrep -o '.*:'
|
2012-07-12 00:20:58 +00:00
|
|
|
)(
|
|
|
|
#Get the list of remote files from the specified ssh server
|
2015-09-09 18:55:04 +00: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 00:20:58 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
"
|
2017-02-02 06:49:40 +00:00
|
|
|
complete -c scp -s B -d "Batch mode"
|
|
|
|
complete -c scp -s l -x -d "Bandwidth limit"
|
|
|
|
complete -c scp -s P -x -d "Port"
|
|
|
|
complete -c scp -s p -d "Preserves modification times, access times, and modes from the original file"
|
|
|
|
complete -c scp -s q -d "Do not display progress bar"
|
|
|
|
complete -c scp -s r -d "Recursively copy"
|
|
|
|
complete -c scp -s S -d "Encryption program"
|