You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
36 lines
705 B
36 lines
705 B
6 years ago
|
#!/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 "$@"
|
||
|
|