From a4f0853ad4f63c2989ca4fd5471310bdb5876217 Mon Sep 17 00:00:00 2001 From: "Danilo M." Date: Sat, 27 Jun 2026 09:48:04 +0200 Subject: feat: complete multiple hint names after -R/--review Co-Authored-By: Claude Opus 4.8 --- mkhint.bash-completion | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/mkhint.bash-completion b/mkhint.bash-completion index ef7759f..896e9a9 100644 --- a/mkhint.bash-completion +++ b/mkhint.bash-completion @@ -10,6 +10,20 @@ _mkhintfile_completions() { local all_flags="--version -v --hintfile -f --new -n --list -l --review -R --clean -c --check -C --delete -d --no-dl -N --help -h" + # -R/--review takes any number of hint names; complete them repeatedly. + local w in_review="" + for w in "${COMP_WORDS[@]:1}"; do + [[ "$w" == "-R" || "$w" == "--review" ]] && in_review=1 + done + if [[ -n "$in_review" && "$cur" != -* ]]; then + local -a rwords=() + for f in "$hint_dir"/*.hint; do + [[ -f "$f" ]] && rwords+=("$(basename "${f%.hint}")") + done + COMPREPLY=($(compgen -W "${rwords[*]}" -- "$cur")) + return + fi + case "$prev" in --new|-n) local -a words=() -- cgit v1.2.3