diff options
author | Wilmer van der Gaast <wilmer@gaast.net> | 2010-08-21 18:59:03 +0100 |
---|---|---|
committer | Wilmer van der Gaast <wilmer@gaast.net> | 2010-08-21 18:59:03 +0100 |
commit | 5613af716212defcf5ee51f8dc13525f54323382 (patch) | |
tree | 486668005a796f641f4d0f902273de6538c7fe10 /root_commands.c | |
parent | 4d4a7ed7b4af600a6b8ce5528cf7ace9c01bf358 (diff) |
Clearer error message when trying to read/write setting that don't exist
(or are not where the user's looking).
Diffstat (limited to 'root_commands.c')
-rw-r--r-- | root_commands.c | 10 |
1 files changed, 9 insertions, 1 deletions
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 |