private function getCompiledHelpCommand(IRequest $request) : ICommand
    {
        $helpCommand = new HelpCommand(new CommandFormatter(), new PaddingFormatter());
        $commandName = null;

        if ($request->getCommandName() === 'help') {
            $compiledHelpCommand = $this->commandCompiler->compile($helpCommand, $request);

            if ($compiledHelpCommand->argumentValueIsSet('command')) {
                $commandName = $compiledHelpCommand->getArgumentValue('command');
            }
        } else {
            $commandName = $request->getCommandName();
        }

        // Set the command only if it was passed as an argument to the help command
        if ($commandName !== null && $commandName !== '') {
            if (!$this->commandCollection->has($commandName)) {
                throw new InvalidArgumentException("No command with name \"$commandName\" exists");
            }

            $command = $this->commandCollection->get($commandName);
            $helpCommand->setCommand($command);
        }

        return $helpCommand;
    }