aboutsummaryrefslogtreecommitdiff
path: root/scripts/vcpkg_completion.bash
diff options
context:
space:
mode:
authorGriffin Downs <grdowns@microsoft.com>2019-02-27 16:44:17 -0800
committerGriffin Downs <grdowns@microsoft.com>2019-02-27 16:44:17 -0800
commit1908903508bf057ad05d8a344e5bc55477944cb6 (patch)
tree2a23595f1e7d8cc9a6358bfd44a00eb7368d8a1b /scripts/vcpkg_completion.bash
parentb0a2ff18c9f2c9131aed131f5bf0d97c0e23da8e (diff)
parent8564602d06d7c4ce236f96a4f0f3ba7c2d769cb0 (diff)
downloadvcpkg-1908903508bf057ad05d8a344e5bc55477944cb6.tar.gz
vcpkg-1908903508bf057ad05d8a344e5bc55477944cb6.zip
Merge branch 'master' of https://github.com/microsoft/vcpkg into dev/grdowns/4802
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