Exemple #1
0
 /**
  * Parse command line arguments into CLImate arguments.
  *
  * @throws \Exception if required arguments aren't defined.
  * @param array $argv
  */
 public function parse(array $argv = null)
 {
     $cliArguments = $this->arguments($argv);
     $unParsedArguments = $this->prefixedArguments($cliArguments);
     $this->nonPrefixedArguments($unParsedArguments);
     // After parsing find out which arguments were required but not
     // defined on the command line.
     $missingArguments = $this->filter->missing();
     if (count($missingArguments) > 0) {
         throw new \Exception('The following arguments are required: ' . $this->summary->short($missingArguments) . '.');
     }
 }