Returns definition printer for provided option argument.

@param string $argument

@return DefinitionPrinter
504237
private function getDefinitionPrinter($argument)
    {
        if ('l' === $argument) {
            return $this->listPrinter;
        }

        if ('i' !== $argument) {
            $this->infoPrinter->setSearchCriterion($argument);
        }

        return $this->infoPrinter;
    }
245337
private function buildCommand($command, $argument)
    {
        $command = sprintf($command, $argument);
        $this->output->writeln(
            'Calling following command:' . "\n" . $command,
            OutputInterface::VERBOSITY_DEBUG
        );

        return $command;
    }
220014
public function format($args)
    {
        if ($this->isArray($args)) {
            $value = vsprintf($this->val(), $args);
        } else {
            if ($this->isInstanceOf($args, new ArrayObject([]))) {
                $value = vsprintf($this->val(), $args->val());
            } else {
                $value = sprintf($this->val(), $args);
            }
        }
        $this->val($value);

        return $this;
    }
258115
protected static function renderArgument( $argument )
	{
		switch( gettype( $argument ) )
		{
			case 'NULL':																			//  handle NULL
				return '<em>NULL</em>';
			case 'boolean':																			//  handle boolean
				return $argument ? "<em>TRUE</em>" : "<em>FALSE</em>";
			case 'array':																			//  handle array
				return self::renderArgumentArray( $argument );
			case 'object':																			//  handle object
				return get_class( $argument );
			default:																				//  handle integer/double/float/real/resource/string
				return self::secureString( (string) $argument );
		}
	}
521000
protected function isArgument($argument, $command_argument)
    {
        $possibilities = [
            $argument->prefix()     => "-{$argument->prefix()}",
            $argument->longPrefix() => "--{$argument->longPrefix()}",
        ];

        foreach ($possibilities as $key => $search) {
            if ($key && strpos($command_argument, $search) === 0) {
                return true;
            }
        }

        return false;
    }
579466
private static function getPrintableOptions($options)
    {
        $printable_options = [];

        // (psst: the is_callable check is needed in order to work with WebPConvert v1.0)
        if (is_callable('ConverterHelper', 'getClassNameOfConverter')) {
            $printable_options = $options;
            if (isset($printable_options['converters'])) {
                foreach ($printable_options['converters'] as &$converter) {
                    if (is_array($converter)) {
                        //echo '::' . $converter['converter'] . '<br>';
                        $className = ConverterHelper::getClassNameOfConverter($converter['converter']);

                        // (pstt: the isset check is needed in order to work with WebPConvert v1.0)
                        if (isset($className::$extraOptions)) {
                            foreach ($className::$extraOptions as $extraOption) {
                                if ($extraOption['sensitive']) {
                                    if (isset($converter['options'][$extraOption['name']])) {
                                        $converter['options'][$extraOption['name']] = '*******';
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
        return $printable_options;
    }
707220
public function appendArgument($argument) {
    if (is_scalar($argument)) {
      $argument = Node::fromValue($argument);
    }

    if ($argument instanceof ExpressionNode) {
      /** @var Node $argument */
      $this->arguments->appendItem($argument);
    }
    else {
      throw new \InvalidArgumentException();
    }

    return $this;
  }
1119774
protected static function parseArguments(array $arguments) {
    $string = '';
    foreach ($arguments as $name => $value) {
      if (is_null($value)) {
        $string .= ' --' . $name;
      }
      else {
        $string .= ' --' . $name . '=' . $value;
      }
    }
    return $string;
  }
839595
private function getInjectionFuncParams(Argument $argument) : array
    {
        $dependencyIndex = (string) $argument;
        if ($this->container->getContainer()[$dependencyIndex] instanceof DependencyProvider) {
            return $this->getInjectionProviderParams($argument);
        }

        return [new Node\Arg(new Scalar\String_((string) $argument))];
    }
780073
protected function getDefinition(): DefinitionInterface
    {
        if ($this->definition === null) {
            $this->definition = (new Definition())
                ->addOption(new Option('verbose', 'Be more verbose.', 'v', 'verbose', true, true))
                ->addOption(new Option('help', 'Show help about shell or command.', 'h', 'help'));
        }

        return $this->definition;
    }
171862
protected function _buildArguments($arguments)
    {
        $output = [];

        foreach ($arguments as $argument => $value) {
            $output[] = $argument . ' ' . $value;
        }

        return implode(' ', $output);
    }
379922
public function getNode(Argument $argument) : Expr
    {
        $dependencyIndex = (string) $argument;
        if (! $this->injector instanceof ScriptInjector) {
            return $this->getDefault($argument);
        }
        try {
            $isSingleton = $this->injector->isSingleton($dependencyIndex);
        } catch (NotCompiled $e) {
            return $this->getDefault($argument);
        }
        $func = $isSingleton ? 'singleton' : 'prototype';
        $args = $this->getInjectionProviderParams($argument);
        $node = new Expr\FuncCall(new Expr\Variable($func), $args);

        return $node;
    }
47069
public function get($argument, $alias = null, $default = null)
    {
        if (isset($this->arguments[$argument])) {
            return $this->arguments[$argument];
        } else
            if (! empty($alias) && isset($this->arguments[$alias])) {
                return $this->arguments[$alias];
            } else {
                return $default;
            }
    }
550189
public function addCommandLineArgument($argument)
    {
        $args = (array) $this->getPhpCliArguments();
        $this->setPhpCliArguments(array_merge($args, [$argument]));

        return $this;
    }
666410
private function escapeArgument($argument)
    {
        if ('\\' !== DIRECTORY_SEPARATOR) {
            return "'".str_replace("'", "'\\''", $argument)."'";
        }
        if ('' === $argument = (string) $argument) {
            return '""';
        }
        if (false !== strpos($argument, "\0")) {
            $argument = str_replace("\0", '?', $argument);
        }
        if (!preg_match('/[\/()%!^"<>&|\s]/', $argument)) {
            return $argument;
        }
        $argument = preg_replace('/(\\\\+)$/', '$1$1', $argument);

        return '"'.str_replace(array('"', '^', '%', '!', "\n"), array('""', '"^^"', '"^%"', '"^!"', '!LF!'), $argument).'"';
    }
831024
protected function renderItem($option)
	{
		if (!($option instanceof Option))
		{
			throw new \InvalidArgumentException('Option descriptor need Command object to describe it.');
		}

		/** @var Option $option */
		$name        = $option->getName();
		$aliases     = $option->getAlias();
		$description = $option->getDescription() ?: 'No description';

		// Merge aliases
		array_unshift($aliases, $name);

		foreach ($aliases as &$alias)
		{
			$alias = strlen($alias) > 1 ? '--' . $alias : '-' . $alias;
		}

		// Sets the body indent.
		$body = array();

		$description = explode("\n", $description);

		foreach ($description as $line)
		{
			$line = trim($line);
			$line = sprintf($this->templateLineBody, $line);
			$body[] = $line;
		}

		return sprintf($this->template, implode(' / ', $aliases), implode("\n", $body));
	}
103264
private function formatArguments(Array $arguments)
    {
        $echoArguments = [];
        $argsLength = 0;
        foreach ($arguments as $argument => $desc) {
            $argument = Colour::colour($argument, Colour::GREEN);
            $echoArguments[$argument] = $desc;
            $argsLength > strlen($argument) || $argsLength = strlen($argument);
        }
        return $echoArguments;
    }