X-Git-Url: http://git.annexia.org/?p=libguestfs.git;a=blobdiff_plain;f=fish%2Fcompletion.c;h=92843e562acd29f72f05708b993df3c52353cab2;hp=264c5840dc97ad481b8c67b32df4e0ad9d38fba0;hb=5e332cc6c06532191f793a6789bafe818f726258;hpb=460d139e6a52da67a4f1947035b1978610349f78 diff --git a/fish/completion.c b/fish/completion.c index 264c584..92843e5 100644 --- a/fish/completion.c +++ b/fish/completion.c @@ -177,6 +177,12 @@ static const char *const commands[] = { "e2fsck-f", "sleep", "ntfs-3g-probe", + "sh", + "sh-lines", + "glob-expand", + "scrub-device", + "scrub-file", + "scrub-freespace", NULL }; @@ -191,6 +197,8 @@ generator (const char *text, int state) len = strlen (text); } + rl_attempted_completion_over = 1; + while ((name = commands[index]) != NULL) { index++; if (strncasecmp (name, text, len) == 0) @@ -207,8 +215,12 @@ char **do_completion (const char *text, int start, int end) char **matches = NULL; #ifdef HAVE_LIBREADLINE + rl_completion_append_character = ' '; + if (start == 0) matches = rl_completion_matches (text, generator); + else if (complete_dest_paths) + matches = rl_completion_matches (text, complete_dest_paths_generator); #endif return matches;