aboutsummaryrefslogtreecommitdiff
path: root/scripts/vcpkg_completion.bash
diff options
context:
space:
mode:
authorPhil Christensen <philc@microsoft.com>2018-12-20 14:56:52 -0800
committerPhil Christensen <philc@microsoft.com>2018-12-20 14:56:52 -0800
commit93ac00106ecc7409dab32366758c75baa9c9bb6a (patch)
tree4681a5fd088ab04ce6fb11a1334e163576d698a7 /scripts/vcpkg_completion.bash
parentf64362201923a20111ced9b789286437a8acac13 (diff)
parent99b06bba5d86a6982f2491d9f4ea7ef637ff3747 (diff)
downloadvcpkg-93ac00106ecc7409dab32366758c75baa9c9bb6a.tar.gz
vcpkg-93ac00106ecc7409dab32366758c75baa9c9bb6a.zip
Merge branch 'master' of https://github.com/microsoft/vcpkg into dev/philc/4994
Diffstat (limited to 'scripts/vcpkg_completion.bash')
-rw-r--r--scripts/vcpkg_completion.bash17
1 files changed, 17 insertions, 0 deletions
diff --git a/scripts/vcpkg_completion.bash b/scripts/vcpkg_completion.bash
new file mode 100644
index 000000000..804507d58
--- /dev/null
+++ b/scripts/vcpkg_completion.bash
@@ -0,0 +1,17 @@
+#/usr/bin/env bash
+
+_vcpkg_completions()
+{
+ local vcpkg_executable=${COMP_WORDS[0]}
+ local remaining_command_line=${COMP_LINE:(${#vcpkg_executable}+1)}
+ COMPREPLY=($(${vcpkg_executable} autocomplete "${remaining_command_line}" -- 2>/dev/null))
+
+ # Colon is treated as a delimiter in bash. The following workaround
+ # allows triplet completion to work correctly in the syntax:
+ # zlib:x64-windows
+ local cur
+ _get_comp_words_by_ref -n : cur
+ __ltrim_colon_completions "$cur"
+}
+
+complete -F _vcpkg_completions vcpkg