commit dd808b3
hovercats
·
2025-09-22 15:16:22 +0000 UTC
parent eea6ac3
dsearch: use dash for all options
1 files changed,
+5,
-5
+5,
-5
1@@ -2,7 +2,7 @@
2
3 flag e +
4
5-fn usage {printf 'Usage: dsearch b|d|s|y <query>\n' && exit 1}
6+fn usage {printf 'Usage: dsearch -b|-d|-s|-y <query>\n' && exit 1}
7
8 # Use dmenu to enter our search query
9 fn string {printf '' | dmenu -c -p 'Search'}
10@@ -14,16 +14,16 @@ BC='https://bandcamp.com/search?q='
11 YT='https://inv.nadeko.net/search?q='
12
13 switch($1) {
14- case b
15+ case -b
16 ENGINE=$BC
17 STRING=`{string | sed 's/ /%2B/g'} # Replace spaces
18- case d
19+ case -d
20 ENGINE=$DDG
21 STRING=`{string | sed 's/ /%20/g'} # Replace spaces
22- case s
23+ case -s
24 ENGINE=$SP
25 STRING=`{string | sed 's/ /%20/g'} # Replace spaces
26- case y
27+ case -y
28 ENGINE=$YT
29 STRING=`{string | sed 's/ /+/g'} # Replace spaces
30 case *