added some sanity checks
[util-vserver.git] / util-vserver / src / vlimit.c
index ae6bffa..9400ef2 100644 (file)
@@ -69,7 +69,7 @@ CMDLINE_OPTIONS[] = {
   { "help",      no_argument,       0, CMD_HELP },
   { "version",   no_argument,       0, CMD_VERSION },
   { "all",       no_argument,       0, 'a' },
-  { "xid",       no_argument,       0, CMD_XID },
+  { "xid",       required_argument, 0, CMD_XID },
   { "dir",       required_argument, 0, CMD_DIR },
   { "missingok", no_argument,       0, CMD_MISSINGOK },
   NUMLIM( 0), NUMLIM( 1), NUMLIM( 2), NUMLIM( 3),
@@ -367,13 +367,13 @@ int main (int argc, char *argv[])
     else switch (c) {
       case CMD_HELP    :  showHelp(1, argv[0], 0);
       case CMD_VERSION :  showVersion();
-      case CMD_XID     :
-      case 'c'         :  ctx        = atoi(optarg); break;
-      case 'a'         :  show_all   = true;         break;
-      case 'n'         :  do_resolve = false;        break;
+      case 'a'         :  show_all   = true;            break;
+      case 'n'         :  do_resolve = false;           break;
+      case CMD_DIR     :  dir        = optarg;          break;
+      case CMD_MISSINGOK:  missing_ok = true;            break;
+      case CMD_XID     :  /*@fallthrough@*/
+      case 'c'         :  ctx = Evc_xidopt2xid(optarg,true);   break;
       case 'd'         :  fmt_func   = utilvserver_fmt_uint64; break;
-      case CMD_DIR     :  dir        = optarg;       break;
-      case CMD_MISSINGOK:  missing_ok = true;         break;
       case 'M'         :
       case 'S'         :
       case 'H'         :