From 7cc3cdb5fc9245ea8654411098c859b6d928be42 Mon Sep 17 00:00:00 2001 From: Andre Noll Date: Fri, 21 Aug 2009 17:20:39 +0200 Subject: [PATCH] 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. --- funcs/gsu | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) 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" -- 2.39.2