diff options
author | dylan.araps@gmail.com <dylan.araps@gmail.com> | 2019-07-23 23:45:19 +0000 |
---|---|---|
committer | dylan.araps@gmail.com <dylan.araps@gmail.com> | 2019-07-23 23:45:19 +0000 |
commit | aec53c3a13818307cde367ba6e6c6e7f572c946a (patch) | |
tree | 9131e7f11b8b2764de5494625233689a7532c6eb | |
parent | 8629fbd9e5ae247bd9a12105a6e38bca1fb27f7b (diff) | |
download | cpt-aec53c3a13818307cde367ba6e6c6e7f572c946a.tar.gz |
search: Allow \*, ?, etc etc
FossilOrigin-Name: 9e6adb8b06b066e296a57b3604258a70823f5630ade7f05053ecac950161efac
-rwxr-xr-x | kiss | 15 |
1 files changed, 13 insertions, 2 deletions
@@ -970,11 +970,22 @@ args() { pkg_updates ;; - # Search packages + # Search for packages. s*) shift [ "$1" ] || die "'kiss search' requires an argument." - for pkg; do pkg_search "$pkg"; done + + for pkg; do + # Create a list of all matching packages. + set -- $(IFS=:; find $KISS_PATH -mindepth 1 \ + -maxdepth 1 -name "$pkg") + + # Print all matches. If there aren't any, print an error. + printf '%s\n' "${@:-$(log "[$pkg] Not installed.")}" + + # Exit with an error if a search fails. + [ "$1" ] || exit 1 + done ;; # Print version and exit. |