cleanups
[util-vserver.git] / util-vserver / src / chxid.c
index e2b6fa8..42bdd17 100644 (file)
@@ -38,7 +38,7 @@ CMDLINE_OPTIONS[] = {
   { 0,0,0,0 }
 };
 
-char const             CMDLINE_OPTIONS_SHORT[] = "Rc:";
+char const             CMDLINE_OPTIONS_SHORT[] = "Rc:x";
 
 void
 showHelp(int fd, char const *cmd, int res)
@@ -46,10 +46,11 @@ showHelp(int fd, char const *cmd, int res)
   WRITE_MSG(fd, "Usage:  ");
   WRITE_STR(fd, cmd);
   WRITE_MSG(fd,
-           " -c <ctx|vserver> [-R] [--] <file>+\n\n"
+           " -c <ctx|vserver> [-Rx] [--] <file>+\n\n"
            " Options:\n"
            "   -R  ...  recurse through directories\n"
            "   -c  ...  assign the given context/vserver to the file(s)\n"
+           "   -x  ...  do not cross filesystems\n\n"
            "Please report bugs to " PACKAGE_BUGREPORT "\n");
   exit(res);
 }
@@ -103,15 +104,17 @@ handleFile(char const *name, char const * display_name,
 }
 
 void
-checkParams(struct Arguments const UNUSED *args, int argc)
+fixupParams(struct Arguments UNUSED *args, int argc)
 {
   if (optind==argc) {
     WRITE_MSG(2, "No filename given; use '--help' for more information\n");
     exit(1);
   }
 
-  if (args->ctx==VC_NOCTX) {
-    WRITE_MSG(2, "No valid context given; use '--help' for more information\n");
+  if (args->ctx_str==0) {
+    WRITE_MSG(2, "No context given; use '--help' for more information\n");
     exit(1);
   }
+
+  args->ctx = resolveCtx(args->ctx_str);
 }