cpt

[ARCHIVED] Carbs Packaging Tools
git clone git://git.ckyln.com/~cem/cpt.git
Log | Files | Refs | README | LICENSE

commit 21f976505556ca1562a9576c1a4cbe3f5c6c6ee1
parent 280974255916b246d5152447f15ca13f78d59955
Author: Cem Keylan <cem@ckyln.com>
Date:   Thu,  7 May 2020 16:07:22 +0300

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.

Diffstat:
Mkiss | 42+++++++++++++++++++++++-------------------
1 file changed, 23 insertions(+), 19 deletions(-)

diff --git 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' ;;