aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormerakor <cem@ckyln.com>2020-05-07 13:07:22 +0000
committermerakor <cem@ckyln.com>2020-05-07 13:07:22 +0000
commit8dab0c3652d6a9e3cf18107b04dce5b0c6e50e1b (patch)
treee76e70a83506a0636014e5a6219f29befb2c6213
parentde996dec4a33a275303606da5ef79e5e6a0cab89 (diff)
downloadcpt-8dab0c3652d6a9e3cf18107b04dce5b0c6e50e1b.tar.gz
kiss: switch to an 'extension' argument for listing extensions.
Extensions used too much screen space. If a user has their own extensions it only gets bigger. kiss extensions are not as important as the package manager itself, so the user shouldn't be required to scroll up everytime they want to list options. If a user wants to be informed about the extensions they can now pass an 'e' or 'extension' argument to kiss. FossilOrigin-Name: ba4281f458c72495261e949cb81b0f36730626de9a5b77bbce8e5b8816756df3
-rwxr-xr-xkiss42
1 files changed, 23 insertions, 19 deletions
diff --git a/kiss b/kiss
index e1128b9..8aea4b3 100755
--- a/kiss
+++ b/kiss
@@ -1438,6 +1438,26 @@ args() {
done
;;
+ e|extension)
+ log "Installed extensions"
+
+ set --
+
+ for path in $(KISS_PATH=$PATH pkg_find kiss-* all); do
+ set -- "${path#*/kiss-}" "$@"
+ max=$((${#1} > max ? ${#1} : max))
+ done
+
+ for path do
+ # These are binary files so they should be ignored
+ contains "readlink stat" "$path" && continue
+
+ printf '\033[31;1m->\033[m %-*s ' "$max" "${path#*/kiss-}"
+ sed -n 's/^# *//;2p' "$(command -v "kiss-$path")"
+ done | sort -uk1 >&2
+
+ ;;
+
r|remove)
pkg_order "$@"
@@ -1453,34 +1473,18 @@ args() {
v|version) log kiss 1.19.0 ;;
h|help|-h|--help|'')
- log 'kiss [a|b|c|f|i|l|r|s|u|v] [pkg] [pkg] [pkg]'
+ log 'kiss [a|b|c|e|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 'extension List available kiss extensions (kiss-* in \$PATH)'
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
- # These are binary files so they should be ignored
- contains "readlink stat" "$path" && continue
-
- printf '\033[31;1m->\033[m %-*s ' "$max" "${path#*/kiss-}"
- sed -n 's/^# *//;2p' "$(command -v "kiss-$path")"
- done | sort -uk1 >&2
+ log 'version Package manager version'
;;