forked from microsoft/vcpkg
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[autocomplete] Add tab-completion support for bash
- Loading branch information
1 parent
93d020f
commit fed9a24
Showing
3 changed files
with
71 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters