diff --git a/src/Shell/HelpShell.php b/src/Shell/HelpShell.php index 06e972a19e5..613ee7a2087 100644 --- a/src/Shell/HelpShell.php +++ b/src/Shell/HelpShell.php @@ -73,15 +73,19 @@ public function main() } if (!$this->commands) { - $this->commands = $this->getCommands(); + $this->commands = new CommandCollection($this->getCommands()); } + $commands = $this->commands->getIterator(); + $commands->ksort(); + $commands = new CommandCollection((array)$commands); + if ($this->param('xml')) { - $this->asXml($this->commands); + $this->asXml($commands); return; } - $this->asText($this->commands); + $this->asText($commands); } /**