Skip to content

Commit

Permalink
pi-gen-micro bash completions
Browse files Browse the repository at this point in the history
  • Loading branch information
roliver-rpi authored and tdewey-rpi committed Oct 2, 2024
1 parent 1841c33 commit db9225c
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 0 deletions.
22 changes: 22 additions & 0 deletions bash-completion/pi-gen-micro
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#!/usr/bin/env bash

function complete_pi-gen-micro() {
if [ "${#COMP_WORDS[@]}" != "2" ]; then
return
fi

local PGM_CONFS="$( \
echo $( \
find \
/etc/pi-gen-micro/configurations \
-mindepth 1 \
-maxdepth 1 \
-type d \
-printf '%P\n' \
) \
)"

COMPREPLY=($(compgen -W "${PGM_CONFS}" -- "${COMP_WORDS[1]}"))
}

complete -F complete_pi-gen-micro pi-gen-micro
1 change: 1 addition & 0 deletions debian/install
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@ configurations /etc/pi-gen-micro
cfg /etc/pi-gen-micro
packages /usr/share/misc/pi-gen-micro
prebuilts /usr/share/misc/pi-gen-micro
bash-completion/* /usr/share/bash-completion/completions

0 comments on commit db9225c

Please sign in to comment.