diff options
| author | Griffin Downs <grdowns@microsoft.com> | 2019-02-27 16:44:17 -0800 |
|---|---|---|
| committer | Griffin Downs <grdowns@microsoft.com> | 2019-02-27 16:44:17 -0800 |
| commit | 1908903508bf057ad05d8a344e5bc55477944cb6 (patch) | |
| tree | 2a23595f1e7d8cc9a6358bfd44a00eb7368d8a1b /scripts/vcpkg_completion.bash | |
| parent | b0a2ff18c9f2c9131aed131f5bf0d97c0e23da8e (diff) | |
| parent | 8564602d06d7c4ce236f96a4f0f3ba7c2d769cb0 (diff) | |
| download | vcpkg-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.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 |
