mirror of
https://codeberg.org/kiss-community/kiss
synced 2024-11-04 22:15:36 -07: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 "$@" ;;
|
||||
u|update) pkg_updates ;;
|
||||
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|'')
|
||||
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)"
|
||||
|
||||
KISS_PATH=$PATH
|
||||
|
||||
for path in $(pkg_find kiss-\* all); do
|
||||
for path in $(KISS_PATH=$PATH pkg_find kiss-\* all); do
|
||||
set -- "${path#*/kiss-}" "$@"
|
||||
max=$((${#1} > max ? ${#1} : max))
|
||||
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"
|
||||
|
||||
"kiss-$action" "$@"
|
||||
"$util" "$@"
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user