Index: res/res_agi.c =================================================================== --- res/res_agi.c (revision 148249) +++ res/res_agi.c (working copy) @@ -2740,9 +2740,9 @@ case CLI_GENERATE: return NULL; } - if (a->argc < e->args) + if (a->argc < e->args - 1 || (a->argc >= e->args && strcasecmp(a->argv[e->args - 1], "topic"))) return CLI_SHOWUSAGE; - if (a->argc > e->args) { + if (a->argc > e->args - 1) { command = find_command(a->argv + e->args, 1); if (command) { ast_cli(a->fd, "%s", command->usage);