fish-shell/init/completions/scp.fish
axel 20b269130c Yet another attempt to avoid gnuisms in sed/grep for ssh completions
darcs-hash:20051218225150-ac50b-d2ec7c6b5c715a68dcc4f2d9d67636c70868da7d.gz
2005-12-19 08:51:50 +10:00

35 lines
821 B
Fish

#
# Load common ssh options
#
complete -y ssh
#
# 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
echo (commandline -ct)|sed -ne 's/\(.*@\).*/\1/p'
)(
cat ~/.ssh/known_hosts{,2} ^/dev/null|cut -d ' ' -f 1| cut -d , -f 1
):
(__fish_print_users)@
"
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 "Disable progress meter"
complete -c scp -s r -d "Recursively copy"
complete -c scp -s S -d "Encyption program"