diff options
| author | Phil Christensen <philc@microsoft.com> | 2018-12-20 13:50:12 -0800 |
|---|---|---|
| committer | Phil Christensen <philc@microsoft.com> | 2018-12-20 13:50:12 -0800 |
| commit | ea831f43024a06700a9d8e901c1cb87844a63d81 (patch) | |
| tree | fd1a423c0f13fda818445d069a73453746d1d9f9 /scripts/vcpkg_completion.bash | |
| parent | 96b282341fd80763ef8533ba6619064ad3e8a60f (diff) | |
| parent | edec46528d897c584ab1d9454b36a58f7fece217 (diff) | |
| download | vcpkg-ea831f43024a06700a9d8e901c1cb87844a63d81.tar.gz vcpkg-ea831f43024a06700a9d8e901c1cb87844a63d81.zip | |
Merge branch 'master' into dev/philc/4966
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 |
