public function helpCommand(string $commandIdentifier = null)
    {
        $exceedingArguments = $this->request->getExceedingArguments();
        if (count($exceedingArguments) > 0 && $commandIdentifier === null) {
            $commandIdentifier = $exceedingArguments[0];
        }

        if ($commandIdentifier === null) {
            $this->displayHelpIndex();
        } else {
            $matchingCommands = $this->commandManager->getCommandsByIdentifier($commandIdentifier);
            $numberOfMatchingCommands = count($matchingCommands);
            if ($numberOfMatchingCommands === 0) {
                $this->outputLine('<error>No command could be found that matches the command identifier "%s".</error>', [$commandIdentifier]);
                $this->quit(1);
            } elseif ($numberOfMatchingCommands > 1) {
                $this->outputLine('<error>%d commands match the command identifier "%s":</error>', [$numberOfMatchingCommands, $commandIdentifier]);
                $this->displayShortHelpForCommands($matchingCommands);
                $this->quit(1);
            } else {
                $this->displayHelpForCommand(array_shift($matchingCommands));
            }
        }
    }
public function helpCommand(string $commandIdentifier = null)
    {
        $exceedingArguments = $this->request->getExceedingArguments();
        if (count($exceedingArguments) > 0 && $commandIdentifier === null) {
            $commandIdentifier = $exceedingArguments[0];
        }

        if ($commandIdentifier === null) {
            $this->displayHelpIndex();
        } else {
            $matchingCommands = $this->commandManager->getCommandsByIdentifier($commandIdentifier);
            $numberOfMatchingCommands = count($matchingCommands);
            if ($numberOfMatchingCommands === 0) {
                $this->outputLine('<error>No command could be found that matches the command identifier "%s".</error>', [$commandIdentifier]);
                $this->quit(1);
            } elseif ($numberOfMatchingCommands > 1) {
                $this->outputLine('<error>%d commands match the command identifier "%s":</error>', [$numberOfMatchingCommands, $commandIdentifier]);
                $this->displayShortHelpForCommands($matchingCommands);
                $this->quit(1);
            } else {
                $this->displayHelpForCommand(array_shift($matchingCommands));
            }
        }
    }
public function helpCommand ( string $ commandIdentifier = null ) { $ exceedingArguments = $ this -> request -> getExceedingArguments ( ) ; if ( count ( $ exceedingArguments ) > 0 && $ commandIdentifier === null ) { $ commandIdentifier = $ exceedingArguments [ 0 ] ; } if ( $ commandIdentifier === null ) { $ this -> displayHelpIndex ( ) ; } else { $ matchingCommands = $ this -> commandManager -> getCommandsByIdentifier ( $ commandIdentifier ) ; $ numberOfMatchingCommands = count ( $ matchingCommands ) ; if ( $ numberOfMatchingCommands === 0 ) { $ this -> outputLine ( '<error>No command could be found that matches the command identifier "%s".</error>' , [ $ commandIdentifier ] ) ; $ this -> quit ( 1 ) ; } elseif ( $ numberOfMatchingCommands > 1 ) { $ this -> outputLine ( '<error>%d commands match the command identifier "%s":</error>' , [ $ numberOfMatchingCommands , $ commandIdentifier ] ) ; $ this -> displayShortHelpForCommands ( $ matchingCommands ) ; $ this -> quit ( 1 ) ; } else { $ this -> displayHelpForCommand ( array_shift ( $ matchingCommands ) ) ; } } }
Display help for a command

The help command displays help for a given command:
./flow help <commandIdentifier>

@param string $commandIdentifier Identifier of a command for more details
@return void
@throws StopActionException
Display help for a command