2 changed files with 36 additions and 0 deletions
@ -0,0 +1,35 @@
@@ -0,0 +1,35 @@
|
||||
#!/bin/bash |
||||
|
||||
#Создан: вт 03 дек 2019 11:14:23 |
||||
#Изменён: вт 03 дек 2019 21:18:38 |
||||
|
||||
BINDIR=${SHELLRC}/bin/ |
||||
|
||||
SCRIPT=cheat.sh |
||||
|
||||
check_cheat() { |
||||
command -V "$SCRIPT" >/dev/null 2>&1 |
||||
} |
||||
|
||||
install_cheat() { |
||||
curl -sq https://cht.sh/:cht.sh > "${BINDIR}/${SCRIPT}" |
||||
|
||||
chmod +x "${BINDIR}/${SCRIPT}" |
||||
|
||||
echo "[INFO] cheat.sh has been installed to ${BINDIR}/${SCRIPT}." |
||||
} |
||||
|
||||
tip() { |
||||
if [[ $1 == @* ]]; then |
||||
CHTSH_QUERY_OPTIONS="style=borland" cheat.sh --shell "${1/@/}" |
||||
elif [[ $1 == %* ]]; then |
||||
echo stealth Q | CHTSH_QUERY_OPTIONS="style=borland" cheat.sh --shell "${1/\%/}" |
||||
else |
||||
CHTSH_QUERY_OPTIONS="style=borland" cheat.sh "$@" | less -R |
||||
fi |
||||
} |
||||
|
||||
check_cheat || install_cheat |
||||
|
||||
tip "$@" |
||||
|
Loading…
Reference in new issue