aboutsummaryrefslogtreecommitdiff
path: root/scripts/vcpkg_completion.bash
diff options
context:
space:
mode:
authorPhil Christensen <philc@microsoft.com>2018-12-21 00:36:36 -0800
committerPhil Christensen <philc@microsoft.com>2018-12-21 00:36:36 -0800
commit09c3cc0d88562083949357e1499130e68c5706c5 (patch)
treec848583011035ab21b43f523b23533055a017723 /scripts/vcpkg_completion.bash
parent0d1229d34babdc9c8fbfe2e1b43b38e657519093 (diff)
parent4afe20fc123d794cd066d1dc19b8873b3a2a3645 (diff)
downloadvcpkg-09c3cc0d88562083949357e1499130e68c5706c5.tar.gz
vcpkg-09c3cc0d88562083949357e1499130e68c5706c5.zip
Merge branch 'master' of https://github.com/microsoft/vcpkg into dev/philc/4990
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