2 # (C) 2006-2011 Andre Noll
8 E_GSU_BAD_COMMAND invalid command
9 E_GSU_NOT_A_NUMBER not a number
10 E_GSU_BAD_CONFIG_VAR invalid config variable
11 E_GSU_NEED_VALUE value required but not given
12 E_GSU_BAD_BOOL bad value for boolian option
13 E_GSU_BAD_OPTION_TYPE invalid option type
14 E_GSU_BAD_ARG_COUNT invalid number of arguments
15 E_GSU_EDITOR failed to execute editor
16 E_GSU_MKDIR failed to create directory
17 E_GSU_GETOPTS getopts error
34 # check if $1 is a number
38 if test "$1" -eq "$1" &> /dev/null; then
41 ret=-$E_GSU_NOT_A_NUMBER
52 gsu_short_msg "$_gsu_self: $1"
57 gsu_short_msg "$_gsu_self $(date): $1"
62 local txt="$result" err
64 gsu_is_a_number "$ret"
65 if test $ret -lt 0; then
66 gsu_msg "unknown error ($ret:$txt)"
69 if test $result -ge 0; then
70 gsu_msg "unknown error ($result:$txt)"
74 if test -n "$txt"; then
75 txt="$txt: ${gsu_error_txt[$err]}"
77 txt="${gsu_error_txt[$err]}"
84 _gsu_self="$(basename $0)"
85 gsu_name="${gsu_name:=$_gsu_self}"
86 gsu_config_var_prefix="${gsu_config_var_prefix:=$gsu_name}"