forked from kiss-community/kiss
kiss: Make 'kiss s' usage saner for scripting.
Changes 'kiss s' to only show the first match if run from a subshell. Here's a simple example: -> kiss s zlib /home/dylan/projects/repo/core/zlib /var/db/kiss/installed/zlib -> echo $(kiss s zlib) /home/dylan/projects/repo/core/zlib ->
This commit is contained in:
parent
21caebdfc5
commit
764c21426f
6
kiss
6
kiss
@ -115,7 +115,7 @@ pkg_find() {
|
|||||||
# Figure out which repository a package belongs to by
|
# Figure out which repository a package belongs to by
|
||||||
# searching for directories matching the package name
|
# searching for directories matching the package name
|
||||||
# in $KISS_PATH/*.
|
# in $KISS_PATH/*.
|
||||||
query=$1 match=$2 IFS=:; set --
|
query=$1 IFS=:; set --
|
||||||
|
|
||||||
# Both counts of word-splitting are intentional here.
|
# Both counts of word-splitting are intentional here.
|
||||||
# Firstly to split the repositories and secondly to
|
# Firstly to split the repositories and secondly to
|
||||||
@ -137,7 +137,7 @@ pkg_find() {
|
|||||||
|
|
||||||
# Show all search results if called from 'kiss search', else
|
# Show all search results if called from 'kiss search', else
|
||||||
# print only the first match.
|
# print only the first match.
|
||||||
[ "$match" ] && printf '%s\n' "$@" || printf '%s\n' "$1"
|
[ -t 1 ] && printf '%s\n' "$@" || printf '%s\n' "$1"
|
||||||
}
|
}
|
||||||
|
|
||||||
pkg_list() {
|
pkg_list() {
|
||||||
@ -1268,7 +1268,7 @@ args() {
|
|||||||
|
|
||||||
l|list) pkg_list "$@" ;;
|
l|list) pkg_list "$@" ;;
|
||||||
u|update) pkg_updates ;;
|
u|update) pkg_updates ;;
|
||||||
s|search) for pkg do pkg_find "$pkg" all; done ;;
|
s|search) for pkg do pkg_find "$pkg"; done ;;
|
||||||
v|version) log kiss 1.10.3 ;;
|
v|version) log kiss 1.10.3 ;;
|
||||||
|
|
||||||
h|help|-h|--help|'')
|
h|help|-h|--help|'')
|
||||||
|
Loading…
Reference in New Issue
Block a user