X-Git-Url: http://git.annexia.org/?a=blobdiff_plain;f=fish%2Fcompletion.c;h=2ddae2e0b37e6252c60b9adb02403d00e182ba33;hb=f20854ec61eef1aea313920f0cf193a78c1a9219;hp=305e810cda22064b31e8a3320c27d21a85e8898b;hpb=6610af333b93d93f6f0f4b917e0caee0d35ba389;p=libguestfs.git diff --git a/fish/completion.c b/fish/completion.c index 305e810..2ddae2e 100644 --- a/fish/completion.c +++ b/fish/completion.c @@ -42,6 +42,8 @@ static const char *const commands[] = { "add", "add-cdrom", "cdrom", + "add-drive-ro", + "add-ro", "config", "set-qemu", "qemu", @@ -63,6 +65,9 @@ static const char *const commands[] = { "is-launching", "is-busy", "get-state", + "set-memsize", + "memsize", + "get-memsize", "mount", "sync", "touch", @@ -173,6 +178,35 @@ static const char *const commands[] = { "resize2fs", "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", NULL }; @@ -187,6 +221,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) @@ -203,8 +239,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;