rem: thread_flags |= TF_show_task; format_modifiers |= FM_T;
context: static const char *parse_sysv_option(void){  const char *arg;  const char *err;  flagptr = ps_argv[thisarg];  while(*++flagptr){    /* Find any excuse to ignore stupid Unix98 misfeatures. */    if(!strchr("aAdefgGlnoptuU", *flagptr)) not_pure_unix = 1;    switch(*flagptr){    case 'A':      trace("-A selects all processes.\n");      all_processes = 1;      break;    case 'C': /* end */      trace("-C select by process name.\n");  /* Why only HP/UX and us? */      arg=get_opt_arg();      if(!arg) return "List of command names must follow -C.";      err=parse_list(arg, parse_cmd);      if(err) return err;      selection_list->typecode = SEL_COMM;      return NULL; /* can't have any more options */    case 'F':  /* DYNIX/ptx -f plus sz,rss,psr=ENG between c and stime */      trace("-F does fuller listing\n");      format_modifiers |= FM_F;      format_flags |= FF_Uf;      unix_f_option = 1; /* does this matter? */      break;    case 'G': /* end */      trace("-G select by RGID (supports names)\n");      arg=get_opt_arg();      if(!arg) return "List of real groups must follow -G.";      err=parse_list(arg, parse_gid);      if(err) return err;      selection_list->typecode = SEL_RGID;      return NULL; /* can't have any more options */    case 'H':     /* another nice HP/UX feature */      trace("-H Process hierarchy (like ASCII art forest option)\n");      forest_type = 'u';      break;    case 'L':  /*  */      /* In spite of the insane 2-level thread system, Sun appears to       * have made this option Linux-compatible. If a process has N       * threads, ps will produce N lines of output. (not N+1 lines)       * Zombies are the only exception, with NLWP==0 and 1 output line.       * SCO UnixWare uses -L too.       */      trace("-L Print LWP (thread) info.\n");      thread_flags |= TF_U_L;      thread_flags |= TF_show_task;      format_modifiers |= FM_L;      break;    case 'M':  /* someday, maybe, we will have MAC like SGI's Irix */      trace("-M Print security label for Mandatory Access Control.\n");      format_modifiers |= FM_M;      return "Sorry, no Mandatory Access Control support.";      break;    case 'N':      trace("-N negates.\n");      negate_selection = 1;      break;    case 'O': /* end */      trace("-O is preloaded -o.\n");      arg=get_opt_arg();      if(!arg) return "Format or sort specification must follow -O.";      defer_sf_option(arg, SF_U_O);      return NULL; /* can't have any more options */    case 'P':     /* SunOS 5 "psr" or unknown HP/UX feature */      trace("-P adds columns of PRM info (HP) or PSR column (Sun)\n");      format_modifiers |= FM_P;      break;#ifdef WE_UNDERSTAND_THIS    case 'R':     /* unknown HP/UX feature */      trace("-R selects PRM groups\n");      return "Don't understand PRM on Linux.";      break;#endif    case 'T':      /* IRIX 6.5 docs suggest POSIX threads get shown individually.       * This would make -T be like -L, -m, and m. (but an extra column)       * Testing (w/ normal processes) shows 1 line/process, not 2.       * Also, testing shows PID==SPID for all normal processes.       */      trace("-T adds strange SPID column (old sproc() threads?)\n");      thread_flags |= TF_U_T;      thread_flags |= TF_show_task;      format_modifiers |= FM_T;      break;    case 'U': /* end */      trace("-U select by RUID (supports names).\n");      arg=get_opt_arg();      if(!arg) return "List of real groups must follow -U.";      err=parse_list(arg, parse_uid);      if(err) return err;      selection_list->typecode = SEL_RUID;      return NULL; /* can't have any more options */    case 'V': /* single */      trace("-V prints version.\n");      exclusive("-V");      display_version();      exit(0);#if 0    case 'Z':     /* full Mandatory Access Control level info */      trace("-Z shows full MAC info\n");      return "Don't understand MAC on Linux.";      break;#endif    case 'a':      trace("-a select all with a tty, but omit session leaders.\n");      simple_select |= SS_U_a;      break;    case 'c':      /* HP-UX and SunOS 5 scheduling info modifier */      trace("-c changes scheduling info.\n");      format_modifiers |= FM_c;      break;    case 'd':      trace("-d select all, but omit session leaders.\n");      simple_select |= SS_U_d;      break;    case 'e':      trace("-e selects all processes.\n");      all_processes = 1;      break;    case 'f':      trace("-f does full listing\n");      format_flags |= FF_Uf;      unix_f_option = 1; /* does this matter? */      break;    case 'g': /* end */      trace("-g selects by session leader OR by group name\n");      arg=get_opt_arg();      if(!arg) return "List of session leaders OR effective group names must follow -g.";      err=parse_list(arg, parse_pid);      if(!err){        selection_list->typecode = SEL_SESS;        return NULL; /* can't have any more options */      }      err=parse_list(arg, parse_gid);      if(!err){        selection_list->typecode = SEL_EGID;        return NULL; /* can't have any more options */      }      return "List of session leaders OR effective group IDs was invalid.";    case 'j':      trace("-j jobs format.\n");      /* Debian uses RD_j and Digital uses JFMT */      if(sysv_j_format) format_flags |= FF_Uj;      else format_modifiers |= FM_j;      break;    case 'l':      trace("-l long format.\n");      format_flags |= FF_Ul;      break;    case 'm':      trace("-m shows threads.\n");      /* note that AIX shows 2 lines for a normal process */      thread_flags |= TF_U_m;      thread_flags |= TF_show_proc;      thread_flags |= TF_show_task;      break;    case 'n': /* end */      trace("-n sets namelist file.\n");      arg=get_opt_arg();      if(!arg) return "Alternate System.map file must follow -n.";      namelist_file = arg;      return NULL; /* can't have any more options */    case 'o': /* end */      /* Unix98 has gross behavior regarding this. From the following: */      /*            ps -o pid,nice=NICE,tty=TERMINAL,comm              */      /* The result must be 2 columns: "PID NICE,tty=TERMINAL,comm"    */      /* Yes, the second column has the name "NICE,tty=TERMINAL,comm"  */      /* This parser looks for any excuse to ignore that braindamage.  */      trace("-o user-defined format.\n");      arg=get_opt_arg();      if(!arg) return "Format specification must follow -o.";      not_pure_unix |= defer_sf_option(arg, SF_U_o);      return NULL; /* can't have any more options */    case 'p': /* end */      trace("-p select by PID.\n");      arg=get_opt_arg();      if(!arg) return "List of process IDs must follow -p.";      err=parse_list(arg, parse_pid);      if(err) return err;      selection_list->typecode = SEL_PID;      return NULL; /* can't have any more options */#ifdef KNOW_WHAT_TO_DO_WITH_THIS    case 'r':      trace("-r some Digital Unix thing about warnings...\n");      trace("   or SCO's option to chroot() for new /proc and /dev.\n");      return "The -r option is reserved.";      break;#endif    case 's': /* end */      trace("-s Select processes belonging to the sessions given.\n");      arg=get_opt_arg();      if(!arg) return "List of session IDs must follow -s.";      err=parse_list(arg, parse_pid);      if(err) return err;      selection_list->typecode = SEL_SESS;      return NULL; /* can't have any more options */    case 't': /* end */      trace("-t select by tty.\n");      arg=get_opt_arg();      if(!arg) return "List of terminals (pty, tty...) must follow -t.";      err=parse_list(arg, parse_tty);      if(err) return err;      selection_list->typecode = SEL_TTY;      return NULL; /* can't have any more options */    case 'u': /* end */      trace("-u select by user ID (the EUID?) (supports names).\n");      arg=get_opt_arg();      if(!arg) return "List of users must follow -u.";      err=parse_list(arg, parse_uid);      if(err) return err;      selection_list->typecode = SEL_EUID;      return NULL; /* can't have any more options */    case 'w':      trace("-w wide output.\n");      w_count++;      break;#ifdef NOBODY_HAS_BSD_HABITS_ANYMORE    case 'x':     /* Same as -y, but for System V Release 4 MP */      trace("-x works like Sun Solaris & SCO Unixware -y option\n");      format_modifiers |= FM_x;      break;#endif    case 'y':  /* Sun's -l hack (also: Irix "lnode" resource control info) */      trace("-y Print lnone info in UID/USER column or do Sun -l hack.\n");      format_modifiers |= FM_y;      break;#if 0    case 'z':     /* alias of Mandatory Access Control level info */      trace("-z shows aliased MAC info\n");      return "Don't understand MAC on Linux.";      break;#endif    case '-':      return "Embedded '-' among SysV options makes no sense.";      break;    case '\0':      return "Please report the \"SysV \\0 can't happen\" bug.";      break;    default:      return "Unsupported SysV option.";    } /* switch */  } /* while */  return NULL;}