diff options
| author | Danilo M. <danix@danix.xyz> | 2026-06-27 09:48:04 +0200 |
|---|---|---|
| committer | Danilo M. <danix@danix.xyz> | 2026-06-27 09:48:04 +0200 |
| commit | a4f0853ad4f63c2989ca4fd5471310bdb5876217 (patch) | |
| tree | 75799e495ea5cd315181def7af1d28b867f122aa | |
| parent | 90f5ad0486158191d0fc03d347fa522d90f1f815 (diff) | |
| download | mkhintfile-a4f0853ad4f63c2989ca4fd5471310bdb5876217.tar.gz mkhintfile-a4f0853ad4f63c2989ca4fd5471310bdb5876217.zip | |
feat: complete multiple hint names after -R/--review
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
| -rw-r--r-- | mkhint.bash-completion | 14 |
1 files changed, 14 insertions, 0 deletions
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=() |
