diff options
| author | Danilo M. <danix@danix.xyz> | 2026-07-09 17:22:55 +0200 |
|---|---|---|
| committer | Danilo M. <danix@danix.xyz> | 2026-07-09 17:22:55 +0200 |
| commit | e94e3fe6e1d30a856913992aafb35bc7dfa2912d (patch) | |
| tree | fc39d885612d6941e7f4d261ec088840c95367fe /mkhint.bash-completion | |
| parent | d74e9388d7d0581758d7aebe699e65c45f7bafb0 (diff) | |
| download | mkhintfile-173861f472f8f07a836242ead44ba90eb35c8eaf.tar.gz mkhintfile-173861f472f8f07a836242ead44ba90eb35c8eaf.zip | |
feat: --info version-compare row; fix -i completion; release v1.2.6v1.2.6
--info/-i now prints a version-compare row between the header and the
README: SBo .info version vs the hint's, greening the higher side (< / >),
yellow on equal (=), '(no hint)' when no hint carries a version, skipped
when the .info has no version. Header stays pinned, version row scrolls
with the README.
Completion: -i now completes package names (was flag-only); package-name
completion for -n/-i drops the broken -maxdepth 2 .info scan for a
param-expansion sweep of REPO_DIR/*/*/ dirs, ~7s -> ~60ms.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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) |
