mirror of
https://codeberg.org/kiss-community/kiss
synced 2024-12-25 16:40:07 -07:00
search: Allow \*, ?, etc etc
This commit is contained in:
parent
0e183d30a3
commit
b2dd5198f2
15
kiss
15
kiss
@ -970,11 +970,22 @@ args() {
|
|||||||
pkg_updates
|
pkg_updates
|
||||||
;;
|
;;
|
||||||
|
|
||||||
# Search packages
|
# Search for packages.
|
||||||
s*)
|
s*)
|
||||||
shift
|
shift
|
||||||
[ "$1" ] || die "'kiss search' requires an argument."
|
[ "$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.
|
# Print version and exit.
|
||||||
|
Loading…
Reference in New Issue
Block a user