getGlobalArgsFormat() public method

Returns the global arguments format of the application.
public getGlobalArgsFormat ( ) : ArgsFormat
return Webmozart\Console\Api\Args\Format\ArgsFormat The global arguments format.
Example #1
0
 /**
  * {@inheritdoc}
  */
 protected function renderHelp(BlockLayout $layout)
 {
     $help = $this->application->getConfig()->getHelp();
     $commands = $this->application->getNamedCommands();
     $globalArgsFormat = $this->application->getGlobalArgsFormat();
     $argsFormat = ArgsFormat::build()->addArgument(new Argument('command', Argument::REQUIRED, 'The command to execute'))->addArgument(new Argument('arg', Argument::MULTI_VALUED, 'The arguments of the command'))->addOptions($globalArgsFormat->getOptions())->getFormat();
     $this->renderName($layout, $this->application);
     $this->renderUsage($layout, $this->application, $argsFormat);
     $this->renderArguments($layout, $argsFormat->getArguments());
     if ($argsFormat->hasOptions()) {
         $this->renderGlobalOptions($layout, $argsFormat->getOptions());
     }
     if (!$commands->isEmpty()) {
         $this->renderCommands($layout, $commands);
     }
     if ($help) {
         $this->renderDescription($layout, $help);
     }
 }
Example #2
0
 /**
  * Returns the inherited arguments format of the command.
  *
  * @return ArgsFormat The inherited format.
  *
  * @see CommandConfig::buildArgsFormat()
  */
 private function getBaseFormat()
 {
     if ($this->parentCommand) {
         return $this->parentCommand->getArgsFormat();
     }
     if ($this->application) {
         return $this->application->getGlobalArgsFormat();
     }
     return null;
 }
Example #3
0
 /**
  * {@inheritdoc}
  */
 protected function getDefaultInputDefinition()
 {
     return new ArgsFormatInputDefinition($this->adaptedApplication->getGlobalArgsFormat());
 }