diff options
| author | Phil Christensen <philc@microsoft.com> | 2019-02-28 14:36:23 -0800 |
|---|---|---|
| committer | Phil Christensen <philc@microsoft.com> | 2019-02-28 14:36:23 -0800 |
| commit | 773c8267dfb506f41c204f61042f30b6143a8095 (patch) | |
| tree | 5946d1526c3ad77a2df80786a1370d96389d931b /scripts/vcpkg_completion.bash | |
| parent | 6afbceb27fd2aa39c66f810a22f5d4ad97575110 (diff) | |
| parent | 7859944528be28bee1fda9f325b78d6a7f02124e (diff) | |
| download | vcpkg-773c8267dfb506f41c204f61042f30b6143a8095.tar.gz vcpkg-773c8267dfb506f41c204f61042f30b6143a8095.zip | |
Merge branch 'master' of https://github.com/microsoft/vcpkg into dev/philc/4564
Diffstat (limited to 'scripts/vcpkg_completion.bash')
| -rw-r--r-- | scripts/vcpkg_completion.bash | 17 |
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 |
