[Console] MarkdownDescriptor: Don't use getLongVersion
This commit is contained in:
parent
fc2395e237
commit
6896865bcc
@ -123,8 +123,9 @@ class MarkdownDescriptor extends Descriptor
|
||||
{
|
||||
$describedNamespace = isset($options['namespace']) ? $options['namespace'] : null;
|
||||
$description = new ApplicationDescription($application, $describedNamespace);
|
||||
$title = $this->getApplicationTitle($application);
|
||||
|
||||
$this->write($application->getLongVersion()."\n".str_repeat('=', Helper::strlen($application->getLongVersion())));
|
||||
$this->write($title."\n".str_repeat('=', Helper::strlen($title)));
|
||||
|
||||
foreach ($description->getNamespaces() as $namespace) {
|
||||
if (ApplicationDescription::GLOBAL_NAMESPACE !== $namespace['id']) {
|
||||
@ -143,4 +144,17 @@ class MarkdownDescriptor extends Descriptor
|
||||
$this->write($this->describeCommand($command));
|
||||
}
|
||||
}
|
||||
|
||||
private function getApplicationTitle(Application $application)
|
||||
{
|
||||
if ('UNKNOWN' !== $application->getName()) {
|
||||
if ('UNKNOWN' !== $application->getVersion()) {
|
||||
return sprintf('%s %s', $application->getName(), $application->getVersion());
|
||||
}
|
||||
|
||||
return $application->getName();
|
||||
}
|
||||
|
||||
return 'Console Tool';
|
||||
}
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
My Symfony application <info>v1.0</info>
|
||||
========================================
|
||||
My Symfony application v1.0
|
||||
===========================
|
||||
|
||||
* [`alias1`](#descriptorcommand1)
|
||||
* [`alias2`](#descriptorcommand1)
|
||||
|
Reference in New Issue
Block a user