Example #1
0
 /**
  * @return string
  */
 public function getHelp()
 {
     $helpText = $this->getName();
     foreach (CM_Cli_Arguments::getNumericForMethod($this->_method) as $paramString) {
         $helpText .= ' ' . $paramString;
     }
     foreach (CM_Cli_Arguments::getNamedForMethod($this->_method) as $paramString) {
         $helpText .= ' [' . $paramString . ']';
     }
     return $helpText;
 }
Example #2
0
 /**
  * @param CM_Cli_Arguments $arguments
  * @throws CM_Cli_Exception_InvalidArguments
  */
 protected function _checkUnusedArguments(CM_Cli_Arguments $arguments)
 {
     if ($arguments->getNumeric()->getParamsDecoded()) {
         throw new CM_Cli_Exception_InvalidArguments('Too many arguments provided');
     }
     if ($named = $arguments->getNamed()->getParamsDecoded()) {
         throw new CM_Cli_Exception_InvalidArguments('Illegal option used: `--' . key($named) . '`');
     }
 }