From 5613af716212defcf5ee51f8dc13525f54323382 Mon Sep 17 00:00:00 2001 From: Wilmer van der Gaast Date: Sat, 21 Aug 2010 18:59:03 +0100 Subject: Clearer error message when trying to read/write setting that don't exist (or are not where the user's looking). --- root_commands.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'root_commands.c') diff --git a/root_commands.c b/root_commands.c index 5b761bb6..ad886f57 100644 --- a/root_commands.c +++ b/root_commands.c @@ -266,6 +266,13 @@ static void cmd_showset( irc_t *irc, set_t **head, char *key ) if( ( val = set_getstr( head, key ) ) ) irc_usermsg( irc, "%s = `%s'", key, val ); + else if( !set_find( head, key ) ) + { + irc_usermsg( irc, "Setting `%s' does not exist.", key ); + if( *head == irc->b->set ) + irc_usermsg( irc, "It might be an account or channel setting. " + "See \x02help account set\x02 and \x02help channel set\x02." ); + } else irc_usermsg( irc, "%s is empty", key ); } @@ -303,7 +310,8 @@ static int cmd_set_real( irc_t *irc, char **cmd, set_t **head, cmd_set_checkflag else st = set_setstr( head, set_name, value ); - if( set_getstr( head, set_name ) == NULL ) + if( set_getstr( head, set_name ) == NULL && + set_find( head, set_name ) ) { /* This happens when changing the passwd, for example. Showing these msgs instead gives slightly clearer -- cgit v1.2.3