aboutsummaryrefslogtreecommitdiffhomepage
path: root/share/completions/scp.fish
diff options
context:
space:
mode:
authorGravatar ridiculousfish <corydoras@ridiculousfish.com>2012-07-11 17:20:58 -0700
committerGravatar ridiculousfish <corydoras@ridiculousfish.com>2012-07-11 17:20:58 -0700
commit830fba64b139ea9cae9ab50ed16711737bc5b171 (patch)
treeb51942b32740e520cd659e8f54f2362bc4dd068c /share/completions/scp.fish
parent1cd61952b07cfff82fe2bdcd6b6bc2fecaf3914e (diff)
Remote completions in scp
Diffstat (limited to 'share/completions/scp.fish')
-rw-r--r--share/completions/scp.fish16
1 files changed, 16 insertions, 0 deletions
diff --git a/share/completions/scp.fish b/share/completions/scp.fish
index c06f4d95..e4996edb 100644
--- a/share/completions/scp.fish
+++ b/share/completions/scp.fish
@@ -25,6 +25,22 @@ complete -c scp -d Hostname -a "
(__fish_print_users)@
"
+
+#
+# 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
+ ssh -o \"BatchMode yes\" (echo (commandline -ct)|sed -ne 's/\(.*\):.*/\1/p') ls\ -d\ (echo (commandline -ct)|sed -ne 's/.*://p')\*
+)
+
+"
+
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"