title: Supplying two arguments to command line option using getopt
body: <p>is there an alternative way to pass two arguments to an option as a single string when using getopt ? Normally I would do the following:</p>
  
  <pre><code>./command -o "key value" [command arguments]
  </code></pre>
  
  <p>Then I would have to split the argument string explicitly</p>
  
  <pre><code> while ((op = getopt(argc, argv, "o:")) != EOF) {
      switch (op) {
               case 'o': 
                   char* result = NULL;
                   result = strtok_r(optarg," ");
                   while(result) {
                       /* DO STUFF */
                       result = strtok(NULL," ");
                   }
  
                   break;
               default:
                   printUsage()
                   break;
     }
  </code></pre>
  
  <p>So, I am wondering if is it possible to do the following:</p>
  
  <pre><code>./command -o key value [command arguments]
  </code></pre>
  
  <p>making getopt treat "value" as -o second argument rather than the command argument.</p>