mirror of
https://codeberg.org/kiss-community/kiss
synced 2024-09-28 12:22:39 -06:00
kiss: Allow partial matches for extensions.
It is now possible to do 'kiss f' instead of 'kiss fork' to give a simple example. In the case where there is a conflict in single lettering, the first match will be used. This extends to 'kiss fo', 'kiss for' and so on.
This commit is contained in:
parent
47de49f92c
commit
bcbdd99e5c
10
kiss
10
kiss
@ -1330,7 +1330,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"; done ;;
|
s|search) for pkg do pkg_find "$pkg"; done ;;
|
||||||
v|version) log kiss 1.10.3 ;;
|
v|version) log kiss 1.11.0 ;;
|
||||||
|
|
||||||
h|help|-h|--help|'')
|
h|help|-h|--help|'')
|
||||||
log 'kiss [a|b|c|i|l|r|s|u|v] [pkg] [pkg] [pkg]'
|
log 'kiss [a|b|c|i|l|r|s|u|v] [pkg] [pkg] [pkg]'
|
||||||
@ -1347,9 +1347,7 @@ args() {
|
|||||||
|
|
||||||
log "Installed extensions (kiss-* in \$PATH)"
|
log "Installed extensions (kiss-* in \$PATH)"
|
||||||
|
|
||||||
KISS_PATH=$PATH
|
for path in $(KISS_PATH=$PATH pkg_find kiss-\* all); do
|
||||||
|
|
||||||
for path in $(pkg_find kiss-\* all); do
|
|
||||||
set -- "${path#*/kiss-}" "$@"
|
set -- "${path#*/kiss-}" "$@"
|
||||||
max=$((${#1} > max ? ${#1} : max))
|
max=$((${#1} > max ? ${#1} : max))
|
||||||
done
|
done
|
||||||
@ -1361,10 +1359,10 @@ args() {
|
|||||||
;;
|
;;
|
||||||
|
|
||||||
*)
|
*)
|
||||||
command -v "kiss-$action" >/dev/null ||
|
util=$(KISS_PATH=$PATH pkg_find "kiss-$action*" 2>/dev/null) ||
|
||||||
die "'kiss $action' is not a valid command"
|
die "'kiss $action' is not a valid command"
|
||||||
|
|
||||||
"kiss-$action" "$@"
|
"$util" "$@"
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user