From 54409423f767d8b1cf30cb7d0efca6b4ca138823 Mon Sep 17 00:00:00 2001 From: Ethan Morgan Date: Sat, 14 Feb 2026 16:44:06 +0000 Subject: move to own git server --- vcpkg/scripts/vcpkg_completion.bash | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 vcpkg/scripts/vcpkg_completion.bash (limited to 'vcpkg/scripts/vcpkg_completion.bash') diff --git a/vcpkg/scripts/vcpkg_completion.bash b/vcpkg/scripts/vcpkg_completion.bash new file mode 100644 index 0000000..d009f73 --- /dev/null +++ b/vcpkg/scripts/vcpkg_completion.bash @@ -0,0 +1,32 @@ +#!/usr/bin/env bash +# set -x + +# To install: +# > vcpkg integrate bash +# This adds the following line to ~/.bashrc: +# source ~/vcpkg/scripts/vcpkg_completion.bash + +# Details: bash and utilities from bash-completion +# Bash commands: compgen, complete +# Input: COMP_WORDS, COMP_CWORD, COMP_LINE, COMP_POINT, COMP_KEY, COMP_WORDBREAKS +# Output: COMPREPLY + +_vcpkg_completions() +{ + local vcpkg_executable=${COMP_WORDS[0]} + local remaining_command_line=${COMP_LINE:(${#vcpkg_executable}+1)} + # echo "rem:$remaining_command_line" + + if [ $COMP_CWORD -eq 1 ]; then + local opts=$(${vcpkg_executable} autocomplete ${remaining_command_line}) + else + local opts=$(${vcpkg_executable} autocomplete ${remaining_command_line} --) + fi + #echo "opts:$opts" + + COMPREPLY=($(compgen -W "${opts}" -- ${COMP_WORDS[COMP_CWORD]}) ) + #echo "COMPREPLY:$COMPREPLY" +} + +complete -F _vcpkg_completions vcpkg + -- cgit v1.2.3