operation="none"
#-- options (bool) --#
+bash_debug=false
debug=false
force_aur=false
msgdebug=false
# Show an INFO message
# $1: message string
msg_info() {
+ if [[ "${msgdebug}" = false ]]; then
+ set +xv
+ fi
local _msg_opts="-a ${wfa_name}"
if [[ "${1}" = "-n" ]]; then
_msg_opts="${_msg_opts} -o -n"
[[ "${msgdebug}" = true ]] && _msg_opts="${_msg_opts} -x"
[[ "${nocolor}" = true ]] && _msg_opts="${_msg_opts} -n"
msg ${_msg_opts} info "${1}"
+ if [[ "${bash_debug}" = true ]]; then
+ set -xv
+ fi
}
# Show an Warning message
# $1: message string
msg_warn() {
+ if [[ "${msgdebug}" = false ]]; then
+ set +xv
+ fi
local _msg_opts="-a ${wfa_name}"
if [[ "${1}" = "-n" ]]; then
_msg_opts="${_msg_opts} -o -n"
[[ "${msgdebug}" = true ]] && _msg_opts="${_msg_opts} -x"
[[ "${nocolor}" = true ]] && _msg_opts="${_msg_opts} -n"
msg ${_msg_opts} warn "${1}"
+ if [[ "${bash_debug}" = true ]]; then
+ set -xv
+ fi
}
# Show an debug message
# $1: message string
msg_debug() {
+ if [[ "${msgdebug}" = false ]]; then
+ set +xv
+ fi
if [[ "${debug}" = true ]]; then
local _msg_opts="-a ${wfa_name}"
if [[ "${1}" = "-n" ]]; then
[[ "${nocolor}" = true ]] && _msg_opts="${_msg_opts} -n"
msg ${_msg_opts} debug "${1}"
fi
+ if [[ "${bash_debug}" = true ]]; then
+ set -xv
+ fi
}
# Show an ERROR message then exit with status
# $1: message string
# $2: exit code number (with 0 does not exit)
msg_error() {
+ if [[ "${msgdebug}" = false ]]; then
+ set +xv
+ fi
local _msg_opts="-a ${wfa_name}"
if [[ "${1}" = "-n" ]]; then
_msg_opts="${_msg_opts} -o -n"
if [[ -n "${2:-}" ]]; then
exit ${2}
fi
+ if [[ "${bash_debug}" = true ]]; then
+ set -xv
+ fi
}
# rm helper
# Parse options
ARGUMENT="${@}"
_opt_short="QRShVdb:ay"
-_opt_long="query,remove,sync,help,version,debug,dbpath:,aururl,aur,noconfirm,config:,makepkg:,mflags:,pacman:,git:,gitflags:,gpg:,gpgflags:,makepkgconf:,nomakepkgconf,nodeps,refresh"
+_opt_long="query,remove,sync,help,version,debug,dbpath:,aururl,aur,noconfirm,config:,makepkg:,mflags:,pacman:,git:,gitflags:,gpg:,gpgflags:,makepkgconf:,nomakepkgconf,nodeps,refresh,bash-debug"
OPT=$(getopt -o ${_opt_short} -l ${_opt_long} -- ${ARGUMENT})
[[ ${?} != 0 ]] && exit 1
nomakepkgconf=true
shift 1
;;
+ --bash-debug)
+ bash_debug=true
+ set -xv
+ shift 1
+ ;;
-h | --help)
usage
shift 1