title: getopt value stays null
body: <p>I am passing my program inputs and I could see them in argv but getopt doesnt seem to have the argument that I expect.</p>
  
  <p>This is how I run my prog: ./my_prog -X -f filename</p>
  
  <pre><code>&lt;snip&gt;
  while ((opt = getopt(argc, argv, "Xf:eE:dD")) != EOF) {
      switch (opt) {
         case 'X':
         case 'f':
                  if (optarg == NULL)
                  fput("no point of living", fp);         &lt;&lt; for debugging
  
  &lt;/snip&gt;
  </code></pre>
  
  <p>I always get optarg as null. WHY?</p>