diff options
Diffstat (limited to 'mkhint.bash-completion')
| -rw-r--r-- | mkhint.bash-completion | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/mkhint.bash-completion b/mkhint.bash-completion index b24992b..031a707 100644 --- a/mkhint.bash-completion +++ b/mkhint.bash-completion @@ -31,11 +31,14 @@ _mkhintfile_completions() { fi case "$prev" in - --new|-n) - local -a words=() - while IFS= read -r f; do - words+=("$(basename "${f%.info}")") - done < <(find "$repo_dir" -mindepth 2 -maxdepth 2 -name "*.info" 2>/dev/null) + --new|-n|--info|-i) + # Packages live at REPO_DIR/<category>/<pkg>/; complete the pkg dir + # names. Strip the trailing slash and category prefix with param + # expansion (no per-dir basename fork — the repo has thousands). + local -a words=() d + for d in "$repo_dir"/*/*/; do + d="${d%/}"; words+=("${d##*/}") + done COMPREPLY=($(compgen -W "${words[*]}" -- "$cur")) ;; --hintfile|-f|--delete|-d|--check|-C) |
