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
18 E_GSU_DIALOG dialog error
19 E_GSU_MKTEMP mktemp error
20 E_GSU_MENU_TREE invalid menu tree
37 # check if $1 is a number
41 if (("$1" == "$1")) &> /dev/null; then
44 ret=-$E_GSU_NOT_A_NUMBER
55 gsu_short_msg "$gsu_name: $1"
60 gsu_short_msg "$gsu_name $(date): $1"
65 local txt="$result" err
67 gsu_is_a_number "$ret"
69 gsu_msg "unknown error ($ret:$txt)"
72 if (($result >= 0)); then
73 gsu_msg "unknown error ($result:$txt)"
77 if test -n "$txt"; then
78 txt="$txt: ${gsu_error_txt[$err]}"
80 txt="${gsu_error_txt[$err]}"
87 gsu_name="${gsu_name:-${0##*/}}"
88 gsu_config_var_prefix="${gsu_config_var_prefix:=$gsu_name}"
89 gsu_banner_txt="${gsu_banner_txt:-set \$gsu_banner_txt to customize this message}"