aboutsummaryrefslogtreecommitdiffstats
path: root/mkhintfile.bash-completion
diff options
context:
space:
mode:
authorDanilo M. <danix@danix.xyz>2026-05-07 16:30:52 +0200
committerDanilo M. <danix@danix.xyz>2026-05-07 16:30:52 +0200
commit03b2f896062ce689df655160328381004b3ad26d (patch)
tree31f43b3767e7fe882c82a5c304e25f58f9d1b926 /mkhintfile.bash-completion
downloadmkhintfile-03b2f896062ce689df655160328381004b3ad26d.tar.gz
mkhintfile-03b2f896062ce689df655160328381004b3ad26d.zip
Initial commit
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Diffstat (limited to 'mkhintfile.bash-completion')
-rw-r--r--mkhintfile.bash-completion33
1 files changed, 33 insertions, 0 deletions
diff --git a/mkhintfile.bash-completion b/mkhintfile.bash-completion
new file mode 100644
index 0000000..e217edf
--- /dev/null
+++ b/mkhintfile.bash-completion
@@ -0,0 +1,33 @@
+# bash completion for mkhintfile.sh
+# Install: sudo cp mkhintfile.bash-completion /etc/bash-completion.d/mkhintfile
+
+_mkhintfile_completions() {
+ local cur prev repo_dir hint_dir
+ _init_completion || return
+
+ repo_dir="/var/lib/sbopkg/SBo-danix"
+ hint_dir="/tmp/hintdir"
+
+ case "$prev" in
+ --new|-n)
+ local -a words=()
+ for f in "$repo_dir"/*.info; do
+ [[ -f "$f" ]] && words+=("$(basename "${f%.info}")")
+ done
+ COMPREPLY=($(compgen -W "${words[*]}" -- "$cur"))
+ ;;
+ --hintfile|-f)
+ local -a words=()
+ for f in "$hint_dir"/*.hint; do
+ [[ -f "$f" ]] && words+=("$(basename "${f%.hint}")")
+ done
+ COMPREPLY=($(compgen -W "${words[*]}" -- "$cur"))
+ ;;
+ # --version (no completion, raw text)
+ # --list, --help (no value completion, flags only)
+ *)
+ ;;
+ esac
+}
+
+complete -F _mkhintfile_completions mkhintfile.sh