X-Git-Url: http://git.tuebingen.mpg.de/?a=blobdiff_plain;f=common;h=fe64cd6b61f690d6ad06da0b2cae747e2ba1f308;hb=77fd8c08604bb7a1c641c4f36bdf4f839d114656;hp=6b87c440afc9ec44e3d9231c7267eeeb914406d3;hpb=44860e92b582709d9787728134446dd4f02790f6;p=gsu.git diff --git a/common b/common index 6b87c44..fe64cd6 100644 --- a/common +++ b/common @@ -1,5 +1,6 @@ #!/bin/bash -# (C) 2006-2011 Andre Noll +# Copyright (C) 2006 Andre Noll +# Licensed under the LGPL, version 3. See COPYING and COPYING.LESSER. _gsu_init_errors() { @@ -15,6 +16,9 @@ E_GSU_BAD_ARG_COUNT invalid number of arguments E_GSU_EDITOR failed to execute editor E_GSU_MKDIR failed to create directory E_GSU_GETOPTS getopts error +E_GSU_DIALOG dialog error +E_GSU_MKTEMP mktemp error +E_GSU_MENU_TREE invalid menu tree $gsu_errors " local a b i=0 @@ -49,12 +53,12 @@ gsu_short_msg() gsu_msg() { - gsu_short_msg "$_gsu_self: $1" + gsu_short_msg "$gsu_name: $1" } gsu_date_msg() { - gsu_short_msg "$_gsu_self $(date): $1" + gsu_short_msg "$gsu_name $(date): $1" } gsu_err_msg() @@ -81,8 +85,7 @@ gsu_err_msg() _gsu_setup() { - _gsu_self="$(basename $0)" - gsu_name="${gsu_name:=$_gsu_self}" + gsu_name="${gsu_name:-${0##*/}}" gsu_config_var_prefix="${gsu_config_var_prefix:=$gsu_name}" gsu_banner_txt="${gsu_banner_txt:-set \$gsu_banner_txt to customize this message}" _gsu_init_errors