- char **matches = (char **) NULL;
-
- rl_completer_word_break_characters = " ";
- if (start == 0) {
- matches = rl_completion_matches(text, command_generator);
- } else {
- rl_bind_key('\t', rl_abort);
- }
-
- return (matches);
-}
-
-
-int do_one_command(int server_socket, char *cmd)
-{
- int i;
- int ret;
- for (i = 0; commands[i].func != NULL; ++i) {
- if (!strncasecmp(cmd, commands[i].name, strlen(commands[i].name))) {
- ret = (*commands[i].func) (server_socket, cmd);
- }
- }
- return ret;
+ rl_attempted_completion_over = 1;
+ return rl_completion_matches(text, command_name_generator);