title: getopt does not parse optional arguments to parameters
body: <p>In C, getopt_long does not parse the optional arguments to command line parameters parameters.</p>
  
  <p>When I run the program, the optional argument is not recognized like the example run below.</p>
  
  <pre><code>$ ./respond --praise John
  Kudos to John
  $ ./respond --blame John
  You suck !
  $ ./respond --blame
  You suck !
  </code></pre>
  
  <p>Here is the test code.</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  #include &lt;getopt.h&gt;
  
  int main(int argc, char ** argv )
  {
      int getopt_ret, option_index;
      static struct option long_options[] = {
                 {"praise",  required_argument, 0, 'p'},
                 {"blame",  optional_argument, 0, 'b'},
                 {0, 0, 0, 0}       };
      while (1) {
          getopt_ret = getopt_long( argc, argv, "p:b::",
                                    long_options,  &amp;option_index);
          if (getopt_ret == -1) break;
  
          switch(getopt_ret)
          {
              case 0: break;
              case 'p':
                  printf("Kudos to %s\n", optarg); break;
              case 'b':
                  printf("You suck ");
                  if (optarg)
                      printf (", %s!\n", optarg);
                  else
                      printf ("!\n", optarg);
                  break;
              case '?':
                  printf("Unknown option\n"); break;
          }
      } 
      return 0;
  }
  </code></pre>