summaryrefslogtreecommitdiff
path: root/.scripts/cht.sh
diff options
context:
space:
mode:
authorSaumit Dinesan <justsaumit@protonmail.com>2022-05-23 19:45:10 +0530
committerSaumit Dinesan <justsaumit@protonmail.com>2022-05-23 19:45:10 +0530
commit415ba843c0dc66bcb84ae0fbd239b40b6818896b (patch)
tree169cd5b6e91173bcb7df22eb29b9f6625735ef9e /.scripts/cht.sh
parentc3362aefa2e762211409923cfff065541bebf9e7 (diff)
minor changes + added old scripts
Diffstat (limited to '.scripts/cht.sh')
-rwxr-xr-x.scripts/cht.sh12
1 files changed, 12 insertions, 0 deletions
diff --git a/.scripts/cht.sh b/.scripts/cht.sh
new file mode 100755
index 0000000..2b724c0
--- /dev/null
+++ b/.scripts/cht.sh
@@ -0,0 +1,12 @@
+#!/bin/sh
+languages=`echo "cpp c python rust golang lua typescript" | tr ' ' '\n'`
+core_utils=`echo "xargs find mv sed awk" | tr ' ' '\n'`
+
+selected=`printf "$languages\n$core_utils" | fzf`
+read -p "query: " query
+
+if printf $languages | grep -qs $selected; then
+ curl cht.sh/$selected/`echo $query | tr ' ' '+' | bat`
+else
+ curl cht.sh/$selected~$query | bat
+fi