Include string.h and libintl.h, as needed.
[libguestfs.git] / rescue / virt-rescue.c
index 0189245..911b80a 100644 (file)
@@ -1,5 +1,5 @@
 /* virt-rescue
 /* virt-rescue
- * Copyright (C) 2010 Red Hat Inc.
+ * Copyright (C) 2010-2011 Red Hat Inc.
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
 
 #include <stdio.h>
 #include <stdlib.h>
 
 #include <stdio.h>
 #include <stdlib.h>
+#include <string.h>
 #include <inttypes.h>
 #include <unistd.h>
 #include <getopt.h>
 #include <errno.h>
 #include <locale.h>
 #include <assert.h>
 #include <inttypes.h>
 #include <unistd.h>
 #include <getopt.h>
 #include <errno.h>
 #include <locale.h>
 #include <assert.h>
+#include <libintl.h>
 
 #include "progname.h"
 #include "xvasprintf.h"
 
 #include "progname.h"
 #include "xvasprintf.h"
@@ -76,6 +78,7 @@ usage (int status)
              "  --selinux            Enable SELinux\n"
              "  -v|--verbose         Verbose messages\n"
              "  -V|--version         Display version and exit\n"
              "  --selinux            Enable SELinux\n"
              "  -v|--verbose         Verbose messages\n"
              "  -V|--version         Display version and exit\n"
+             "  -w|--rw              Mount read-write\n"
              "  -x                   Trace libguestfs API calls\n"
              "For more information, see the manpage %s(1).\n"),
              program_name, program_name, program_name,
              "  -x                   Trace libguestfs API calls\n"
              "For more information, see the manpage %s(1).\n"),
              program_name, program_name, program_name,
@@ -94,6 +97,8 @@ main (int argc, char *argv[])
   bindtextdomain (PACKAGE, LOCALEBASEDIR);
   textdomain (PACKAGE);
 
   bindtextdomain (PACKAGE, LOCALEBASEDIR);
   textdomain (PACKAGE);
 
+  parse_config ();
+
   enum { HELP_OPTION = CHAR_MAX + 1 };
 
   static const char *options = "a:c:d:m:rvVx";
   enum { HELP_OPTION = CHAR_MAX + 1 };
 
   static const char *options = "a:c:d:m:rvVx";
@@ -107,6 +112,7 @@ main (int argc, char *argv[])
     { "memsize", 1, 0, 'm' },
     { "network", 0, 0, 0 },
     { "ro", 0, 0, 'r' },
     { "memsize", 1, 0, 'm' },
     { "network", 0, 0, 0 },
     { "ro", 0, 0, 'r' },
+    { "rw", 0, 0, 'w' },
     { "selinux", 0, 0, 0 },
     { "verbose", 0, 0, 'v' },
     { "version", 0, 0, 'V' },
     { "selinux", 0, 0, 0 },
     { "verbose", 0, 0, 'v' },
     { "version", 0, 0, 'V' },
@@ -189,6 +195,10 @@ main (int argc, char *argv[])
       OPTION_V;
       break;
 
       OPTION_V;
       break;
 
+    case 'w':
+      OPTION_w;
+      break;
+
     case 'x':
       OPTION_x;
       break;
     case 'x':
       OPTION_x;
       break;