aboutsummaryrefslogtreecommitdiff
path: root/kiss
diff options
context:
space:
mode:
Diffstat (limited to 'kiss')
-rwxr-xr-xkiss45
1 files changed, 33 insertions, 12 deletions
diff --git a/kiss b/kiss
index 1431f7b..f08b195 100755
--- a/kiss
+++ b/kiss
@@ -128,7 +128,7 @@ pkg_find() {
set +f
for path2 in "$path/"$query; do
- [ -d "$path2" ] && set -f -- "$@" "$path2"
+ [ -e "$path2" ] && set -f -- "$@" "$path2"
done
done
@@ -1338,19 +1338,40 @@ args() {
h|help|-h|--help|'')
log 'kiss [a|b|c|f|i|l|r|s|u|v] [pkg] [pkg] [pkg]'
- log 'alternatives: List and swap to alternatives'
- log 'build: Build a package'
- log 'checksum: Generate checksums'
- log 'fetch: Fetch repositories'
- log 'install: Install a package'
- log 'list: List installed packages'
- log 'remove: Remove a package'
- log 'search: Search for a package'
- log 'update: Check for updates'
- log 'version: Package manager version'
+ log 'alternatives List and swap to alternatives'
+ log 'build Build a package'
+ log 'checksum Generate checksums'
+ log 'fetch Fetch repositories'
+ log 'install Install a package'
+ log 'list List installed packages'
+ log 'remove Remove a package'
+ log 'search Search for a package'
+ log 'update Check for updates'
+ log 'version Package manager version
+ '
+ log "Installed extensions (kiss-* in \$PATH)"
+
+ set --
+
+ for path in $(KISS_PATH=$PATH pkg_find kiss-* all); do
+ set -- "${path#*/kiss-}" "$@"
+ max=$((${#1} > max ? ${#1} : max))
+ done
+
+ for path do
+ printf '\033[31;1m->\033[m %-*s ' "$max" "${path#*/kiss-}"
+ sed -n 's/^# *//;2p' "$(command -v "kiss-$path")"
+ done | sort -uk1 >&2
+
;;
- *) die "'kiss $action' is not a valid command" ;;
+ *)
+ util=$(KISS_PATH=$PATH pkg_find "kiss-$action"* 2>/dev/null) ||
+ die "'kiss $action' is not a valid command"
+
+ "$util" "$@"
+ ;;
+
esac
}