diff options
author | dylan.araps@gmail.com <dylan.araps@gmail.com> | 2020-02-06 11:42:56 +0000 |
---|---|---|
committer | dylan.araps@gmail.com <dylan.araps@gmail.com> | 2020-02-06 11:42:56 +0000 |
commit | 5384ae409f609f5418374a54cd3c7f15cddd51ee (patch) | |
tree | 7e6e4c5a9fe25796d9a308d8124a6168ec316990 | |
parent | a94667d38a4d78f6e645bf0a138d77a4867923a9 (diff) | |
download | cpt-5384ae409f609f5418374a54cd3c7f15cddd51ee.tar.gz |
kiss: avoid creating argument list
FossilOrigin-Name: 82ac7bc84949e2ba2781fe726c1beb9d3c0f7da1483a470a2a2326b671c3cb3d
-rwxr-xr-x | kiss | 14 |
1 files changed, 5 insertions, 9 deletions
@@ -1234,19 +1234,15 @@ args() { pkg_swap "$@" else - log "Alternatives:" - - # Go to the choices directory and hide errors - # as there is nothing to list if the directory - # doesn't exist. - cd "$sys_db/../choices" 2>/dev/null set +f # Go over each alternative and format the file # name for listing. (pkg_name>usr>bin>ls) - for pkg in *; do - [ "$pkg" = '*' ] || printf '%s\n' "$pkg" - done | sed 's|>| /|;s|>|/|g' + for pkg in "$sys_db/../choices"/*; do + printf '%s\n' "${pkg##*/}" + done | + + sed 's|>| /|; s|>|/|g; /\*/d' fi ;; |