Clean up some visual problems in the code

This commit is contained in:
Nick Chambers 2021-06-28 15:49:44 -05:00
parent 190c1534ed
commit 95d9c06b7b
1 changed files with 12 additions and 8 deletions

20
rowbot
View File

@ -59,10 +59,6 @@ error() {
# utilities # utilities
### ###
parent() {
(( BASHPID == $$ ))
}
has() { has() {
hash "$1" 2>/dev/null hash "$1" 2>/dev/null
} }
@ -80,6 +76,14 @@ die() {
exit "$status" exit "$status"
} }
is-parent() {
(( BASHPID == $$ ))
}
is-channel() {
[[ ${1:0:1} = \# ]]
}
is-log-level() { is-log-level() {
local level local level
@ -94,7 +98,7 @@ is-log-level() {
### ###
# argument parser for parsing arguments # argument parser for parsing arguments
## ###
original_args=( "$@" ) original_args=( "$@" )
declare -A opts declare -A opts
@ -128,7 +132,7 @@ prog_args=( "$@" )
### ###
# default config # default config
## ###
server=irc.libera.chat port=6667 tls=no client_cert= server=irc.libera.chat port=6667 tls=no client_cert=
nick=rowbot-dev ident=rowbot realname=rowbot chan= nick=rowbot-dev ident=rowbot realname=rowbot chan=
@ -286,7 +290,7 @@ cleanup() {
fi fi
} }
if parent; then if is-parent; then
trap cleanup EXIT trap cleanup EXIT
fi fi
@ -694,7 +698,7 @@ who() {
### ###
# app hooks # app hooks
## ###
hook_pre_PRIVMSG_nolog() { hook_pre_PRIVMSG_nolog() {
local words local words