X-Git-Url: http://git.annexia.org/?p=libguestfs.git;a=blobdiff_plain;f=fish%2Fcompletion.c;h=b506559b9fa35ff9953a82235463b250bce348b8;hp=95c3e5d5edcc21a14493a79b984323ae17e41704;hb=da85ed425dc828ef4b8817f64d448101a88507b5;hpb=b6adf09c4d2cc3f1d0285950c151b1fd7688ec67 diff --git a/fish/completion.c b/fish/completion.c index 95c3e5d..b506559 100644 --- a/fish/completion.c +++ b/fish/completion.c @@ -65,6 +65,9 @@ static const char *const commands[] = { "is-launching", "is-busy", "get-state", + "set-memsize", + "memsize", + "get-memsize", "mount", "sync", "touch", @@ -176,6 +179,35 @@ static const char *const commands[] = { "find", "e2fsck-f", "sleep", + "ntfs-3g-probe", + "sh", + "sh-lines", + "glob-expand", + "scrub-device", + "scrub-file", + "scrub-freespace", + "mkdtemp", + "wc-l", + "wc-w", + "wc-c", + "head", + "head-n", + "tail", + "tail-n", + "df", + "df-h", + "du", + "initrd-list", + "mount-loop", + "mkswap", + "mkswap-L", + "mkswap-U", + "mknod", + "mkfifo", + "mknod-b", + "mknod-c", + "umask", + "readdir", NULL }; @@ -190,6 +222,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) @@ -206,8 +240,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;