diff options
author | Benjamin Franzke <benjaminfranzke@googlemail.com> | 2011-09-27 06:45:43 +0200 |
---|---|---|
committer | Benjamin Franzke <benjaminfranzke@googlemail.com> | 2011-09-27 06:45:43 +0200 |
commit | caec298a482ed93140401185bf866edacad35742 (patch) | |
tree | 890720c3613671a70562de623c9d4de21310f163 /src/io.c | |
parent | 8ee1bc1d4f559ed2a048bf9c1fa5e3a88eb542c5 (diff) | |
download | cmumble-caec298a482ed93140401185bf866edacad35742.tar.gz cmumble-caec298a482ed93140401185bf866edacad35742.tar.bz2 cmumble-caec298a482ed93140401185bf866edacad35742.zip |
Add support for command shortcuts
So that distinct substrings of commands,
can be used as shortcuts.
Diffstat (limited to 'src/io.c')
-rw-r--r-- | src/io.c | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -66,6 +66,7 @@ static void process_line(char *line) { struct cmumble_context *ctx = global_rl_user_data; + const char *cmd; int i; g_assert(global_rl_user_data); @@ -80,8 +81,10 @@ process_line(char *line) return; } + cmd = cmumble_command_complete(line); + for (i = 0; ctx->commands[i].name; ++i) { - if (strcmp(line, ctx->commands[i].name) == 0) { + if (strcmp(cmd, ctx->commands[i].name) == 0) { ctx->commands[i].callback(ctx); break; } |