X-Git-Url: http://git.annexia.org/?p=libguestfs.git;a=blobdiff_plain;f=fish%2Ffish.c;h=0fc14ce15dd2c1a962af170971d43663d260ba1f;hp=fbb26deff81dfa691e532ae1a7ac987f8bd3d5b4;hb=8358ea9524509c02448fe52d5bea205c9c3f869e;hpb=b4c040d30e2677313a892ffe4cde0d53e446da7d diff --git a/fish/fish.c b/fish/fish.c index fbb26de..0fc14ce 100644 --- a/fish/fish.c +++ b/fish/fish.c @@ -78,13 +78,14 @@ usage (void) " ...\n" " EOF\n" "Options:\n" - " -h|--cmd-help List available commands\n" - " -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" - /*" --ro|-r All mounts are read-only\n"*/ - " -v|--verbose Verbose messages\n" - "For more information, see the manpage guestfish(1).\n"); + " -h|--cmd-help List available commands\n" + " -h|--cmd-help cmd Display detailed help on 'cmd'\n" + " -a|--add image Add image\n" + " -m|--mount 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"); } int @@ -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,16 @@ main (int argc, char *argv[]) exit (1); } + guestfs_set_autosync (g, 1); + + /* If developing, add . to the path. Note that libtools interferes + * with this because uninstalled guestfish is a shell script that runs + * the real program with an absolute path. Detect that too. + */ + if (argv[0] && + (argv[0][0] != '/' || strstr (argv[0], "/.libs/lt-") != NULL)) + guestfs_set_path (g, ".:" GUESTFS_DEFAULT_PATH); + for (;;) { c = getopt_long (argc, argv, options, long_options, NULL); if (c == -1) break; @@ -153,6 +165,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);