bm

bibliography manager for latex
git clone git://git.ckyln.com/bm.git
Log | Files | Refs | README | LICENSE

commit b7e7dc6e4c2bb913e2c0e6cd9b1719d89c0b6620
parent a298e527c5b5bec737b88d6e3a30f1eb065ce87a
Author: Cem Keylan <cem@ckyln.com>
Date:   Wed, 23 Oct 2019 10:31:56 +0300

exit with exitcode 1 if wrong argument is given

Diffstat:
Mbm | 6++++--
1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/bm b/bm @@ -21,6 +21,8 @@ error() { printf "Error: $1\\n" >&2 ; exit 1;} msgexit() { printf "$1\\n" ; exit;} usage() { + exitcode=$1 + [ -z $1 ] && exitcode="0" cat <<EOF Usage: ${0##*/} <option> [parameter] @@ -39,7 +41,7 @@ Usage: ${0##*/} <option> [parameter] You must have exported a \$BIB variable where BIB is your bibliography file EOF -exit +exit $exitcode } checkbib() { @@ -136,5 +138,5 @@ case $1 in version) getversion ;; entry) entry ;; help) usage;; - *) printf "${0##*/} -- Unknown option: $1\n\n"; usage ;; + *) printf "${0##*/} -- Unknown option: $1\n\n"; usage 1 ;; esac