From 7113cc33f1fa48f389a9065111700382d282286f Mon Sep 17 00:00:00 2001 From: Mahmoud Al-Qudsi Date: Thu, 14 Sep 2017 13:39:12 -0500 Subject: [PATCH] Make s3cmd completions compatible with python3 environment It seems that under python3, s3cmd emits its output as a long list (like ls -l) with or without the --long parameter to "s3cmd ls s3://...". This patch includes only s3://* paths from that output as completions. --- share/completions/s3cmd.fish | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/share/completions/s3cmd.fish b/share/completions/s3cmd.fish index 7cad2d39a..76c4862b9 100644 --- a/share/completions/s3cmd.fish +++ b/share/completions/s3cmd.fish @@ -9,7 +9,7 @@ function __s3cmd_is_valid_remote_path end # Completions to allow for autocomplete of remote paths -complete -c s3cmd -f -n "__s3cmd_is_valid_remote_path" -a "(s3cmd ls (commandline -ct) 2>/dev/null)" +complete -c s3cmd -f -n "__s3cmd_is_valid_remote_path" -a "(s3cmd ls (commandline -ct) 2>/dev/null | string match -r -- 's3://.*')" complete -c s3cmd -f -n "__s3cmd_is_remote_path" # Supress file completions for initial command