Implemented autosync, make it the default for guestfish.
[libguestfs.git] / fish / fish.c
index fbb26de..90f3a10 100644 (file)
@@ -82,6 +82,7 @@ usage (void)
           "  -h|--cmd-help cmd   Display detailed help on 'cmd'\n"
           "  -a image            Add image\n"
           "  -m dev[:mnt]        Mount dev on mnt (if omitted, /)\n"
+          "  -n|--no-sync        Don't autosync\n"
           /*"  --ro|-r             All mounts are read-only\n"*/
           "  -v|--verbose        Verbose messages\n"
           "For more information, see the manpage guestfish(1).\n");
@@ -96,6 +97,7 @@ main (int argc, char *argv[])
     { "cmd-help", 2, 0, 'h' },
     { "help", 0, 0, '?' },
     { "mount", 1, 0, 'm' },
+    { "no-sync", 0, 0, 'n' },
     { "verbose", 0, 0, 'v' },
     { 0, 0, 0, 0 }
   };
@@ -113,6 +115,8 @@ main (int argc, char *argv[])
     exit (1);
   }
 
+  guestfs_set_autosync (g, 1);
+
   for (;;) {
     c = getopt_long (argc, argv, options, long_options, NULL);
     if (c == -1) break;
@@ -153,6 +157,10 @@ main (int argc, char *argv[])
       mps = mp->next;
       break;
 
+    case 'n':
+      guestfs_set_autosync (g, 0);
+      break;
+
     case 'v':
       verbose++;
       guestfs_set_verbose (g, verbose);