diff options
author | Timo Sirainen <cras@irssi.org> | 2002-01-20 16:57:06 +0000 |
---|---|---|
committer | cras <cras@dbcabf3a-b0e7-0310-adc4-f8d773084564> | 2002-01-20 16:57:06 +0000 |
commit | f12d3914e580ea1bd4d55d94190e9e59aea14f86 (patch) | |
tree | fb2328ac559529e1e83e4dee3fb15b46b386fdfd /src/core | |
parent | 93061dd48fca1b85ddcca611502435c068d0a1d8 (diff) | |
download | irssi-f12d3914e580ea1bd4d55d94190e9e59aea14f86.zip |
Added -before and -after options to /LASTLOG. You can also use
-<number> to specify both before and after values.
Added special "#" option name to commands which specifies that
-<number> parameter is allowed.
git-svn-id: http://svn.irssi.org/repos/irssi/trunk@2331 dbcabf3a-b0e7-0310-adc4-f8d773084564
Diffstat (limited to 'src/core')
-rw-r--r-- | src/core/commands.c | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/src/core/commands.c b/src/core/commands.c index 9d7cfe2d..f1119069 100644 --- a/src/core/commands.c +++ b/src/core/commands.c @@ -565,9 +565,9 @@ static int get_cmd_options(char **data, int ignore_unknown, break; } - if (!isspace(**data)) + if (!isspace(**data)) { option = cmd_get_param(data); - else { + } else { option = "-"; (*data)++; } @@ -575,6 +575,18 @@ static int get_cmd_options(char **data, int ignore_unknown, /* check if this option can have argument */ pos = optlist == NULL ? -1 : option_find(optlist, option); + + if (pos == -1 && optlist != NULL && + is_numeric(option, '\0')) { + /* check if we want -<number> option */ + pos = option_find(optlist, "#"); + if (pos != -1) { + g_hash_table_insert(options, "#", + option); + pos = -3; + } + } + if (pos == -1 && !ignore_unknown) { /* unknown option! */ *data = option; @@ -591,7 +603,7 @@ static int get_cmd_options(char **data, int ignore_unknown, option = optlist[pos] + iscmdtype(*optlist[pos]); } - if (options != NULL) + if (options != NULL && pos != -3) g_hash_table_insert(options, option, ""); if (pos < 0 || !iscmdtype(*optlist[pos]) || |