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