public function getCommand()
    {
        $command = $this->getCommandName();

        if (is_null($command)) {
            throw new \RuntimeException("commandName must be specified to build a subcommand");
        }

        $command .= ' ';
        $args = $this->getCommandArguments();
        if (count($args) > 0) {
            $command .= $this->extractArguments($args);
            $command .= ' ';
        }
        $subjects = $this->getCommandSubjects();
        if (count($subjects) > 0) {
            $command .= implode(' ', array_map('escapeshellarg', $subjects));
        }
        $command = preg_replace('/\\s{2,}/', ' ', $command);

        return trim($command);
    }