Beispiel #1
0
 /**
  * @access private
  *
  */
 function _parseCloneOption(&$opts, $short_options, $long_options)
 {
     $opt_keys = array();
     foreach ($opts as $opt) {
         $opt_keys[] = $opt[0];
     }
     if (sizeof($opt_keys) > 1) {
         /*
          * sort the array value (keys)
          */
         sort($opt_keys);
         /*
          * Get the key size
          */
         $key_size = sizeof($opt_keys) - 1;
         foreach ($opt_keys as $key => $val) {
             /*
              * check if we haven't reach the end
              */
             if ($key <= $key_size) {
                 if ($opt_keys[$key] == $opt_keys[$key + 1]) {
                     if (strlen($opt_keys[$key]) > 1) {
                         /*
                          * Keys length greater than 1 is treated as long option
                          * 
                          * @todo : implement long options 
                          */
                         # return Console_Getopt::_parseCloneLongOption($long_options);
                     } else {
                         $error = Console_Getopt::_parseCloneShortOption($opt_keys[$key], $short_options);
                         if ($error == false) {
                             return false;
                         }
                     }
                 }
             }
         }
     }
     return true;
 }