1
0
Fork 0

urlhandler: Allow commands with options

This commit is contained in:
tastytea 2022-04-15 07:21:59 +02:00
parent a000b85b90
commit 35ebd713e5
Signed by: tastytea
SSH Key Fingerprint: SHA256:FBkvrOlhq5use1XEttyUGT4bUTDVA1ar9SgIc9P03cM
1 changed files with 2 additions and 2 deletions

View File

@ -35,7 +35,7 @@ local selected_cmd=${default_cmd}
for regex cmds in ${(kv)assignments}; do
if [[ ${urls[1]} -pcre-match ${regex} ]]; then
for cmd in ${(s/;/)cmds}; do
if type ${cmd} >& -; then
if type ${cmd%% *} >& -; then
selected_cmd=${cmd}
break
fi
@ -44,4 +44,4 @@ for regex cmds in ${(kv)assignments}; do
fi
done
${selected_cmd} ${urls}
eval ${selected_cmd} ${urls}