Fix dependencies in perl so it doesn't always rebuild
[libguestfs.git] / fish / completion.c
index 305e810..92843e5 100644 (file)
@@ -42,6 +42,8 @@ static const char *const commands[] = {
   "add",
   "add-cdrom",
   "cdrom",
+  "add-drive-ro",
+  "add-ro",
   "config",
   "set-qemu",
   "qemu",
@@ -173,6 +175,14 @@ static const char *const commands[] = {
   "resize2fs",
   "find",
   "e2fsck-f",
+  "sleep",
+  "ntfs-3g-probe",
+  "sh",
+  "sh-lines",
+  "glob-expand",
+  "scrub-device",
+  "scrub-file",
+  "scrub-freespace",
   NULL
 };
 
@@ -187,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)
@@ -203,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;