|
@@ -381,6 +381,28 @@ class Command
|
|
|
return $this->help;
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * Returns the processed help for the command replacing the %command.name% and
|
|
|
+ * %command.full_name% patterns with the real values dynamically.
|
|
|
+ *
|
|
|
+ * @return string The processed help for the command
|
|
|
+ */
|
|
|
+ public function getProcessedHelp()
|
|
|
+ {
|
|
|
+ $name = $this->namespace.':'.$this->name;
|
|
|
+
|
|
|
+ $placeholders = array(
|
|
|
+ '%command.name%',
|
|
|
+ '%command.full_name%'
|
|
|
+ );
|
|
|
+ $replacements = array(
|
|
|
+ $name,
|
|
|
+ $_SERVER['PHP_SELF'].' '.$name
|
|
|
+ );
|
|
|
+
|
|
|
+ return str_replace($placeholders, $replacements, $this->getHelp());
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* Sets the aliases for the command.
|
|
|
*
|
|
@@ -463,7 +485,7 @@ class Command
|
|
|
|
|
|
$messages[] = $this->definition->asText();
|
|
|
|
|
|
- if ($help = $this->getHelp())
|
|
|
+ if ($help = $this->getProcessedHelp())
|
|
|
{
|
|
|
$messages[] = '<comment>Help:</comment>';
|
|
|
$messages[] = ' '.implode("\n ", explode("\n", $help))."\n";
|