/* (non-phpdoc)
@see Pheanstalk_Command::getCommandLine()
485262
public function getCommandLine()
	{
		return sprintf(
			'put %d %d %d %d',
			$this->_priority,
			$this->_delay,
			$this->_ttr,
			$this->getDataLength()
		);
	}
936295
public function getCommandLine()
    {
        if (\Yii::$app === null || !$this->getIsConsoleRequest()) {
            return null;
        }

        $params = [];
        if (isset($_SERVER['argv'])) {
            $params = $_SERVER['argv'];
        }
        return implode(' ', $params);
    }
698663
public function getCommand( $args )
    {
        $class = strtoupper( substr( $args[ 1 ], 0, 1 ) ) . substr( $args[ 1 ], 1 );
        $class .= 'Command';

        /** @var Command $command */
        $command = NULL;

        if ( class_exists( $class ) )
        {
            $command = new $class();
        }

        if ( NULL === $command && !empty( $this->namespaces ) )
        {
            foreach ( $this->namespaces as $ns )
            {
                $name = $ns . $class;

                if ( class_exists( $name ) )
                {
                    $command = new $name();
                    $command->init( $args );

                    break;
                }
            }
        }

        if ( NULL !== $command )
        {
            $command->configure();
        }

        return $command;
    }
219650
public function getPreparedCommand(callable $wrapper = null): string
    {
        $finder = new PhpExecutableFinder();
        $php    = $finder->find(false);

        if (false === $php) {
            throw new PhpExecutableNotFound('Unable to find php executable.');
        }

        $commandLine = join(" ", [$php, $this->scriptName, $this->scriptArgs]);

        return $this->decorate($commandLine);
    }
214132
protected function getPhpMigCommands()
    {
        return [
            new Command\CheckCommand(),
            new Command\DownCommand(),
            new Command\GenerateCommand(),
            new Command\MigrateCommand(),
            new Command\RedoCommand(),
            new Command\RollbackCommand(),
            new Command\StatusCommand(),
            new Command\UpCommand(),
        ];
    }
205393
@Override
    protected <T> T getCommand(Class<T> clazz) {
        return getCommand(commands, clazz, this, api, extension);
    }
1324887
protected function _getCommand()
    {
        $binary = $this->getConfig('binary');

        if ($binary) {
            $this->_binary = $binary;
        }
        if (!is_executable($this->_binary)) {
            throw new Exception(sprintf('wkhtmltopdf binary is not found or not executable: %s', $this->_binary));
        }

        $options = [
            'quiet' => true,
            'print-media-type' => true,
            'orientation' => $this->_Pdf->orientation(),
            'page-size' => $this->_Pdf->pageSize(),
            'encoding' => $this->_Pdf->encoding(),
            'title' => $this->_Pdf->title(),
            'javascript-delay' => $this->_Pdf->delay(),
            'window-status' => $this->_Pdf->windowStatus(),
        ];

        $margin = $this->_Pdf->margin();
        foreach ($margin as $key => $value) {
            if ($value !== null) {
                $options['margin-' . $key] = $value . 'mm';
            }
        }
        $options = array_merge($options, (array)$this->getConfig('options'));

        if ($this->_windowsEnvironment) {
            $command = '"' . $this->_binary . '"';
        } else {
            $command = $this->_binary;
        }

        foreach ($options as $key => $value) {
            if (empty($value)) {
                continue;
            } elseif (is_array($value)) {
                foreach ($value as $k => $v) {
                    $command .= sprintf(' --%s %s %s', $key, escapeshellarg($k), escapeshellarg($v));
                }
            } elseif ($value === true) {
                $command .= ' --' . $key;
            } else {
                $command .= sprintf(' --%s %s', $key, escapeshellarg($value));
            }
        }
        $footer = $this->_Pdf->footer();
        foreach ($footer as $location => $text) {
            if ($text !== null) {
                $command .= " --footer-$location \"" . addslashes($text) . "\"";
            }
        }

        $header = $this->_Pdf->header();
        foreach ($header as $location => $text) {
            if ($text !== null) {
                $command .= " --header-$location \"" . addslashes($text) . "\"";
            }
        }
        $command .= " - -";

        if ($this->_windowsEnvironment) {
            $command = '"' . $command . '"';
        }

        return $command;
    }
156654
public function getCmdString()
    {
        // Add no-debug arg if it isn't already present
        if (!$this->debug && !$this->isNoDebugArgPresent()) {
            $this->createArg()->setName("no-debug");
        }
        $cmd = [
            Commandline::quoteArgument($this->console),
            $this->command,
            implode(' ', $this->args)
        ];
        $cmd = implode(' ', $cmd);

        return $cmd;
    }
594176
protected function getServerCommandLine()
    {
        $this->checkJar(self::$ngJarFile);
        $this->checkJar(self::$jarFile);

        $classPath = array(
            self::$ngJarFile,
            self::$jarFile,
        );

        // The command for the server that should show up in the process list
        $server = array(
            self::$javaExecutable,
            '-server',
            '-cp', implode(':', $classPath),
            self::NG_SERVER,
        );

        return $server;
    }
799493
public function getCommand(string $name): AbstractCommand
	{
		$this->initCommands();

		if (!$this->hasCommand($name))
		{
			throw new CommandNotFoundException(sprintf('The command "%s" does not exist.', $name));
		}

		// If the command isn't registered, pull it from the loader
		if (!isset($this->commands[$name]))
		{
			$this->addCommand($this->commandLoader->get($name));
		}

		$command = $this->commands[$name];

		// If the user requested help, we'll fetch the help command now and inject the user's command into it
		if ($this->wantsHelp)
		{
			$this->wantsHelp = false;

			/** @var HelpCommand $helpCommand */
			$helpCommand = $this->getCommand('help');
			$helpCommand->setCommand($command);

			return $helpCommand;
		}

		return $command;
	}
1095025
protected function getGitCommand(): string
    {
        return 'log --pretty=format:' .  escapeshellarg($this->format)
               . $this->abbrev
               . $this->author
               . $this->merges
               . $this->since;
    }
852499
private function getExecutedCommand()
    {
        $pathDirs = explode(PATH_SEPARATOR, $_SERVER['PATH']);
        $executedCommand = $_SERVER['PHP_SELF'];
        $executedCommandDir = dirname($executedCommand);

        if (in_array($executedCommandDir, $pathDirs)) {
            $executedCommand = basename($executedCommand);
        }

        return $executedCommand;
    }
457128
protected function getExecutedCommand()
    {
        $commandBinary = $_SERVER['PHP_SELF'];
        $commandBinaryDir = dirname($commandBinary);
        $pathDirs = explode(PATH_SEPARATOR, $_SERVER['PATH']);
        if (in_array($commandBinaryDir, $pathDirs)) {
            $commandBinary = basename($commandBinary);
        }

        $commandName = $this->getName();

        if ('new' === $commandName) {
            $commandArguments = sprintf('%s %s', $this->projectName, ('latest' !== $this->version) ? $this->version : '');
        } elseif ('demo' === $commandName) {
            $commandArguments = '';
        }

        return sprintf('%s %s %s', $commandBinary, $commandName, $commandArguments);
    }
293742
protected function getArtisanLine()
    {
        $command = $this->app['request']->server('argv', []);

        if (is_array($command)) {
            $command = implode(' ', $command);
        }

        return $command;
    }
375469
public function getCommand(): Command
    {
        if ($this->command === null) {
            $this->command = new Command($this->controllerObjectName, $this->controllerCommandName);
        }
        return $this->command;
    }
126137
public function getCommand()
    {
        $options = $this->getOptions();
        $arguments = $this->getArguments();

        $to = null;
        $from = $arguments['from'];

        if (true === isset($arguments['to'])) {
            $to = $arguments['to'];
        }

        array_walk($options, function (&$option) {
            $option = '--' . $option;
        });

        array_walk($arguments, function (&$value, $argument) {
            $value = '--' . $argument . '=' . $value;
        });

        return trim(sprintf('%s %s %s', $this->getBaseCommand(), $this->getRange($from, $to), join(' ', $options)));
    }
512895
public static function getCommand() {
		foreach (self::$commands as $command => $attributes) {
			if (isset(self::$options[$command]) || isset(self::$options[$attributes["commandShort"]])) {
				return $command;
			}
		}
		return false;
	}