aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordylan.araps@gmail.com <dylan.araps@gmail.com>2019-07-23 23:45:19 +0000
committerdylan.araps@gmail.com <dylan.araps@gmail.com>2019-07-23 23:45:19 +0000
commitaec53c3a13818307cde367ba6e6c6e7f572c946a (patch)
tree9131e7f11b8b2764de5494625233689a7532c6eb
parent8629fbd9e5ae247bd9a12105a6e38bca1fb27f7b (diff)
downloadcpt-aec53c3a13818307cde367ba6e6c6e7f572c946a.tar.gz
search: Allow \*, ?, etc etc
FossilOrigin-Name: 9e6adb8b06b066e296a57b3604258a70823f5630ade7f05053ecac950161efac
-rwxr-xr-xkiss15
1 files changed, 13 insertions, 2 deletions
diff --git a/kiss b/kiss
index cffb669..8ad10a6 100755
--- a/kiss
+++ b/kiss
@@ -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.