summaryrefslogtreecommitdiffstats
path: root/fish/fish.c
diff options
context:
space:
mode:
authorRichard Jones <rjones@trick.home.annexia.org>2009-06-18 21:06:22 +0100
committerRichard Jones <rjones@trick.home.annexia.org>2009-06-18 21:06:22 +0100
commite395d7db8fd3fe3d1b121258fe2f401d6b3e64c8 (patch)
treee825bef2cf986c4d3cc3db34fcb19ee85cb27979 /fish/fish.c
parentace1f0ee2b0a2534e45f14599e38d2d06a03d4d4 (diff)
downloadlibguestfs-e395d7db8fd3fe3d1b121258fe2f401d6b3e64c8.tar.gz
libguestfs-e395d7db8fd3fe3d1b121258fe2f401d6b3e64c8.tar.xz
libguestfs-e395d7db8fd3fe3d1b121258fe2f401d6b3e64c8.zip
Add tab-completion of guest filenames (currently disabled).
Diffstat (limited to 'fish/fish.c')
-rw-r--r--fish/fish.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/fish/fish.c b/fish/fish.c
index da2d6d21..e66880f2 100644
--- a/fish/fish.c
+++ b/fish/fish.c
@@ -102,6 +102,7 @@ usage (void)
" -h|--cmd-help List available commands\n"
" -h|--cmd-help cmd Display detailed help on 'cmd'\n"
" -a|--add image Add image\n"
+ " -D|--no-dest-paths Don't tab-complete paths from guest fs\n"
" -m|--mount dev[:mnt] Mount dev on mnt (if omitted, /)\n"
" -n|--no-sync Don't autosync\n"
" -r|--ro Mount read-only\n"
@@ -119,6 +120,7 @@ main (int argc, char *argv[])
{ "cmd-help", 2, 0, 'h' },
{ "help", 0, 0, '?' },
{ "mount", 1, 0, 'm' },
+ { "no-dest-paths", 0, 0, 'D' },
{ "no-sync", 0, 0, 'n' },
{ "ro", 0, 0, 'r' },
{ "verbose", 0, 0, 'v' },
@@ -178,6 +180,10 @@ main (int argc, char *argv[])
drvs = drv;
break;
+ case 'D':
+ complete_dest_paths = 0;
+ break;
+
case 'h':
if (optarg)
display_command (optarg);
@@ -694,6 +700,16 @@ free_strings (char **argv)
free (argv);
}
+int
+count_strings (char * const * const argv)
+{
+ int c;
+
+ for (c = 0; argv[c]; ++c)
+ ;
+ return c;
+}
+
void
print_strings (char * const * const argv)
{