From 1e28c6726ba601f43330c1b9a82389b17393442b Mon Sep 17 00:00:00 2001 From: "Danilo M." Date: Mon, 29 Jun 2026 11:14:20 +0200 Subject: Initial commit: is_installed script with GPLv2 license Slackware package query tool plus bash completion. Add GPLv2 LICENSE, per-file headers, README, and CLAUDE.md. Co-Authored-By: Claude Opus 4.8 --- is_installed.bash-completion | 48 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 is_installed.bash-completion (limited to 'is_installed.bash-completion') diff --git a/is_installed.bash-completion b/is_installed.bash-completion new file mode 100644 index 0000000..4c3eaa0 --- /dev/null +++ b/is_installed.bash-completion @@ -0,0 +1,48 @@ +# bash completion for is_installed +# -*- shell-script -*- +# +# Copyright (C) 2026 Danilo M. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. + +_is_installed() +{ + local cur prev words cword + _init_completion -n = || return + + local split=false + + local i action + for (( i=1; i<${#words[@]}; i++ )); do + if [[ "${words[i]}" != -* ]]; then + action="${words[i]}" + break + fi + done + + case "$action" in + help) + # no argument required + return + ;; + info) + COMPREPLY=( $(cd /var/log/packages; compgen -f -- "$cur") ) + return + ;; + file-search) + # argument required but no way to help + return + ;; + *) + COMPREPLY+=( $(compgen -W 'help info file-search' -- "$cur") ) + return + ;; + esac + +} + +complete -F _is_installed is_installed + +# ex: filetype=sh -- cgit v1.2.3