Returns the global arguments format of the application.
public getGlobalArgsFormat ( ) : |
||
return | The global arguments format. |
/** * {@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); } }
/** * 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; }
/** * {@inheritdoc} */ protected function getDefaultInputDefinition() { return new ArgsFormatInputDefinition($this->adaptedApplication->getGlobalArgsFormat()); }