From: Andre Noll Date: Fri, 21 Aug 2009 15:20:39 +0000 (+0200) Subject: gsu: Allow help/man/prefs command even on invalid configs. X-Git-Url: http://git.tuebingen.mpg.de/?p=gsu.git;a=commitdiff_plain;h=7cc3cdb5fc9245ea8654411098c859b6d928be42;hp=dc19534d89830005716d9c9d90ea94c794ae4700 gsu: Allow help/man/prefs command even on invalid configs. These generic subcommands do not need the config file. It's pointless to refuse to print the help e.g. if a required config variable is unset. Also, use the name of the executable as the default value for gsu_name. --- diff --git a/funcs/gsu b/funcs/gsu index 129757a..9ee2d72 100644 --- a/funcs/gsu +++ b/funcs/gsu @@ -345,12 +345,15 @@ gsu() local i _gsu_self="$(basename $0)" + gsu_name="${gsu_name:=$_gsu_self}" gsu_config_var_prefix="${gsu_config_var_prefix:=$gsu_name}" _gsu_init_errors _gsu_check_options if [[ "$ret" -lt 0 ]]; then - gsu_err_msg - exit 1 + if [[ "$1" != "help" && "$1" != "man" && "$1" != "prefs" ]]; then + gsu_err_msg + exit 1 + fi fi _gsu_available_commands gsu_cmds="$result"