Support search queries that start with a dash
Example: 'saury -As -- -hg'
This commit is contained in:
parent
899ba881a6
commit
86d1942d74
14
saury
14
saury
|
@ -70,7 +70,7 @@ end
|
|||
function aur_search
|
||||
set query $argv
|
||||
|
||||
if test (string length "$query") -lt 2
|
||||
if test (string length -- "$query") -lt 2
|
||||
error "search query must be at least 2 characters long"
|
||||
end
|
||||
|
||||
|
@ -100,11 +100,11 @@ function aur_search
|
|||
set popularity $results[(math $i \* 7)]
|
||||
|
||||
set_color --bold
|
||||
echo -n (string join "" \
|
||||
echo -n (string join -- "" \
|
||||
(set_color CC3399) "aur/" \
|
||||
(set_color normal; set_color --bold) (string replace -a -i \
|
||||
(set_color normal; set_color --bold) (string replace -a -i -- \
|
||||
"$query" \
|
||||
(string join "" (set_color 33CCB3) \
|
||||
(string join -- "" (set_color 33CCB3) \
|
||||
"$query" \
|
||||
(set_color normal; set_color --bold)) \
|
||||
"$name"))
|
||||
|
@ -123,7 +123,7 @@ function aur_search
|
|||
echo -n " ($package_base)"
|
||||
end
|
||||
|
||||
echo -n (string join "" \
|
||||
echo -n (string join -- "" \
|
||||
(set_color normal; set_color --bold) ' (' \
|
||||
(set_color CC6733) "+$votes" \
|
||||
(set_color normal; set_color --bold) ' | ' \
|
||||
|
@ -149,9 +149,9 @@ function aur_search
|
|||
echo
|
||||
|
||||
set_color normal
|
||||
echo (string replace -a -i \
|
||||
echo (string replace -a -i -- \
|
||||
"$query" \
|
||||
(string join "" (set_color 33CCB3) \
|
||||
(string join -- "" (set_color 33CCB3) \
|
||||
"$query" \
|
||||
(set_color normal)) \
|
||||
" $description")
|
||||
|
|
Loading…
Reference in New Issue