Add the get-colorbool option and associated parameters to the command line.

@param string    $name        The name of the color to check.

@param bool|null $stdoutIsTty Flag if stdout is a tty.

@return ConfigCommandBuilder
344120
public function getColorBool($name, $stdoutIsTty = null)
    {
        $this->arguments[] = '--get-colorbool';
        $this->arguments[] = $name;
        if (\is_bool($stdoutIsTty)) {
            $this->arguments[] = $stdoutIsTty ? 'true' : 'false';
        }
        return $this;
    }
565579
public function addCommand(
        string $name,
        string $description,
        array $operands = null,
        array $options = null,
        array $parameters = null
    ): ShellBuilder {
        $definition = new Definition();
        foreach ($operands ?? [] as $operand) {
            $definition->addOperand(
                new Operand($operand['name'])
            );
        }

        foreach ($options ?? [] as $option) {
            $definition->addOption(
                new Option(
                    $option['name'],
                    $option['description'],
                    $option['short'] ?? null,
                    $option['long'] ?? null,
                    $option['flag'] ?? null,
                    $option['multiple'] ?? null
                )
            );
        }

        $this->commands[] = new Command(
            $name,
            $description,
            $definition,
            $parameters
        );

        return $this;
    }
1084799
public function color($name, array $options = []): FieldTypeInterface
    {
        return (new ColorType($name))
            ->setLocale($this->app->getLocale())
            ->setViewFactory($this->viewFactory)
            ->setOptions($options);
    }
456638
public function getCommand($name = null)
    {
        if ($name !== null) {
            return isset($this->commands[$name]) ? $this->commands[$name] : null;
        }

        return $this->command;
    }
706744
private function getCommand()
    {
        $php = array(PHP_BINARY);
        $args = array_slice($_SERVER['argv'], 1);

        if (!$this->persistent) {
            // Use command-line options
            array_push($php, '-n', '-c', $this->tmpIni);
        }

        if (defined('STDOUT') && Process::supportsColor(STDOUT)) {
            $args = Process::addColorOption($args, $this->colorOption);
        }

        $args = array_merge($php, array($this->script), $args);

        $cmd = Process::escape(array_shift($args), true, true);
        foreach ($args as $arg) {
            $cmd .= ' '.Process::escape($arg);
        }

        return $cmd;
    }
328979
private static function getOption(InputInterface $input, string $name, bool $default = false): bool
    {
        return $input->hasOption($name) ? (bool) $input->getOption($name) : $default;
    }
952634
protected function input($name)
    {
        $cli = $this->climate();
        $arg = $this->argument($name);

        if ($arg) {
            $type = (isset($arg['inputType']) ? $arg['inputType'] : 'input');

            if (isset($arg['prompt'])) {
                $label = $arg['prompt'];
            } elseif (isset($arg['description'])) {
                $label = $arg['description'];
            } else {
                $label = $name;
            }

            if (isset($arg['choices'])) {
                $arg['options'] = $arg['choices'];
                $arg['acceptValue'] = $arg['choices'];
            }

            $accept = true;
        } else {
            $type   = 'input';
            $label  = $name;
            $accept = false;
        }

        $prompt = 'prompt';
        switch ($type) {
            case 'checkboxes':
            case 'radio':
                if (!isset($arg['options'])) {
                    throw new RuntimeException(
                        sprintf('The [%s] argument has no options.', $name)
                    );
                }

                $accept = false;
                $input  = $cli->{$type}($label, $arg['options'], $this->climateReader);
                break;

            case 'confirm':
                $prompt = 'confirmed';
                $input  = $cli->confirm($label, $this->climateReader);
                break;

            case 'password':
                $input = $cli->password($label, $this->climateReader);
                $input->multiLine();
                break;

            case 'multiline':
                $input = $cli->input($label, $this->climateReader);
                $input->multiLine();
                break;

            default:
                $input = $cli->input($label, $this->climateReader);
                break;
        }

        if ($accept) {
            if (isset($arg['acceptValue'])) {
                if (is_array($arg['acceptValue']) || is_callable($arg['acceptValue'])) {
                    $input->accept($arg['acceptValue']);
                }
            }
        }

        return $input->{$prompt}();
    }
734397
public function buildCustomProvider(string $name, array $driverConfig = null)
    {
        if (!$driverConfig) {
            $driverConfig = $this->getConfig('drivers.' . $name);
        }

        $driverConfig['name'] = $name;

        if (isset($driverConfig['enabled']) && $driverConfig['enabled'] === false) {
            return null;
        }

        if (!isset($driverConfig['redirect'])) {
            $driverConfig['redirect'] = $this->getConfig('routes.redirect') . '/' . $name;
        }

        if (!isset($driverConfig['callback'])) {
            $driverConfig['callback'] = $this->getConfig('routes.callback') . '/' . $name;
        }

        if ($this->hasBuildInDriver($name)) {
            $this->drivers[ $name ] = $this->{static::buildInDriverMethodName($name)}($driverConfig);
        } else {
            $provider = (!empty($driverConfig['provider']) && class_exists((string)$driverConfig['provider']))
                ? $driverConfig['provider']
                : CustomProvider::class;

            $this->drivers[ $name ] = $this->buildProvider($provider, $driverConfig);
        }

        return $this->drivers[ $name ];
    }
1084404
public function get($name)
    {
        if (!isset($this->commands[$name])) {
            throw new CommandNotFoundException(sprintf('The command "%s" does not exist.', $name));
        }

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

        if ($this->wantHelps) {
            $this->wantHelps = false;

            $helpCommand = $this->get('help');
            $helpCommand->setCommand($command);

            return $helpCommand;
        }

        return $command;
    }
21997
public function optionModeRequired($name, $description, $defaultValue = null)
    {
        $shortcut = null;
        $mode = InputOption::VALUE_REQUIRED;
        return [$name, $shortcut, $mode, $description, $defaultValue];
    }
1372648
function terminalStyle( $name )
    {
        if ( isset( $this->TerminalStyles[$name] ) )
        {
            return $this->TerminalStyles[$name];
        }
        return false;
    }
1139890
protected function getInlineOption($name, $str, $defaultValue)
	{
		if(preg_match('/'.$name.'(\s*=\s*(\d+))?/i', $str, $v) && count($v) > 2)
			return $v[2];
		else
			return $defaultValue;
	}
1142989
public function getEnv($name = null, $defaultValue = null) 
    {
        if ($name === null) {
            return $_ENV;
        }
        return (isset($_ENV[$name])) ? $_ENV[$name] : $defaultValue;
    }
173870
public static Color getRGBColor(String name)
			throws IllegalArgumentException {
		int[] c = { 0, 0, 0, 0 };
		if (name.startsWith("#")) {
			if (name.length() == 4) {
				c[0] = Integer.parseInt(name.substring(1, 2), 16) * 16;
				c[1] = Integer.parseInt(name.substring(2, 3), 16) * 16;
				c[2] = Integer.parseInt(name.substring(3), 16) * 16;
				return new Color(c[0], c[1], c[2], c[3]);
			}
			if (name.length() == 7) {
				c[0] = Integer.parseInt(name.substring(1, 3), 16);
				c[1] = Integer.parseInt(name.substring(3, 5), 16);
				c[2] = Integer.parseInt(name.substring(5), 16);
				return new Color(c[0], c[1], c[2], c[3]);
			}
			throw new IllegalArgumentException(
					"Unknown color format. Must be #RGB or #RRGGBB");
		}
        else if (name.startsWith("rgb(")) {
            StringTokenizer tok = new StringTokenizer(name, "rgb(), \t\r\n\f");
            for (int k = 0; k < 3; ++k) {
                String v = tok.nextToken();
                if (v.endsWith("%"))
                    c[k] = Integer.parseInt(v.substring(0, v.length() - 1)) * 255 / 100;
                else
                    c[k] = Integer.parseInt(v);
                if (c[k] < 0)
                    c[k] = 0;
                else if (c[k] > 255)
                    c[k] = 255;
            }
            return new Color(c[0], c[1], c[2], c[3]);
        }
		name = name.toLowerCase();
		if (!NAMES.containsKey(name))
			throw new IllegalArgumentException("Color '" + name
					+ "' not found.");
		c = (int[]) NAMES.get(name);
		return new Color(c[0], c[1], c[2], c[3]);
	}
610118
public function getCommand($name, array $args = [])
    {
        if (!$this->description->hasOperation($name)) {
            $name = ucfirst($name);
            if (!$this->description->hasOperation($name)) {
                throw new \InvalidArgumentException(
                    "No operation found named {$name}"
                );
            }
        }

        // Merge in default command options
        $args += $this->getConfig('defaults');

        return parent::getCommand($name, $args);
    }
1222865
protected function _parseFunction($name, $args)
    {
        $res = '';
        switch ($name) {
            case 'if':
                $res = 'if('.$this->_parseFinal($args, $this->_allowedInExpr).'):';
                array_push($this->_blockStack, 'if');
                break;

            case 'else':
                if (substr(end($this->_blockStack), 0, 2) != 'if') {
                    $this->doError1('errors.tpl.tag.block.end.missing', end($this->_blockStack));
                } else {
                    $res = 'else:';
                }
                break;

            case 'elseif':
                if (end($this->_blockStack) != 'if') {
                    $this->doError1('errors.tpl.tag.block.end.missing', end($this->_blockStack));
                } else {
                    $res = 'elseif('.$this->_parseFinal($args, $this->_allowedInExpr).'):';
                }
                break;

            case 'foreach':
                if ($this->trusted) {
                    $notallowed = array(';','!');
                } else {
                    $notallowed = array(';','!','(');
                }

                if (preg_match("/^\s*\((.*)\)\s*$/", $args, $m)) {
                    $args = $m[1];
                }

                $res = 'foreach('.$this->_parseFinal($args, $this->_allowedInForeach, $notallowed).'):';
                array_push($this->_blockStack, 'foreach');
                break;

            case 'while':
                $res = 'while('.$this->_parseFinal($args, $this->_allowedInExpr).'):';
                array_push($this->_blockStack, 'while');
                break;

            case 'for':
                if ($this->trusted) {
                    $notallowed = array();
                } else {
                    $notallowed = array('(');
                }
                if (preg_match("/^\s*\((.*)\)\s*$/", $args, $m)) {
                    $args = $m[1];
                }
                $res = 'for('.$this->_parseFinal($args, $this->_allowedInExpr, $notallowed).'):';
                array_push($this->_blockStack, 'for');
                break;

            case '/foreach':
            case '/for':
            case '/if':
            case '/while':
                $short = substr($name, 1);
                if (end($this->_blockStack) != $short) {
                    $this->doError1('errors.tpl.tag.block.end.missing', end($this->_blockStack));
                } else {
                    array_pop($this->_blockStack);
                    $res = 'end'.$short.';';
                }
                break;

            case 'assign':
            case 'eval':
                $res = $this->_parseFinal($args, $this->_allowedAssign).';';
                break;

            case 'literal':
                if (count($this->_literals)) {
                    $res = '?>'.array_shift($this->_literals).'<?php ';
                } else {
                    $this->doError1('errors.tpl.tag.block.end.missing', 'literal');
                }
                break;

            case '/literal':
                $this->doError1('errors.tpl.tag.block.begin.missing', 'literal');
                break;

            case 'meta':
                $this->_parseMeta($args);
                break;

            case 'meta_if':
                $metaIfArgs = $this->_parseFinal($args, $this->_allowedInExpr);
                $this->_metaBody .= 'if('.$metaIfArgs.'):'."\n";
                array_push($this->_blockStack, 'meta_if');
                break;

            case 'meta_else':
                if (substr(end($this->_blockStack), 0, 7) != 'meta_if') {
                    $this->doError1('errors.tpl.tag.block.end.missing', end($this->_blockStack));
                } else {
                    $this->_metaBody .= "else:\n";
                }
                break;

            case 'meta_elseif':
                if (end($this->_blockStack) != 'meta_if') {
                    $this->doError1('errors.tpl.tag.block.end.missing', end($this->_blockStack));
                } else {
                    $elseIfArgs = $this->_parseFinal($args, $this->_allowedInExpr);
                    $this->_metaBody .= 'elseif('.$elseIfArgs."):\n";
                }
                break;

            case '/meta_if':
                $short = substr($name, 1);
                if (end($this->_blockStack) != $short) {
                    $this->doError1('errors.tpl.tag.block.end.missing', end($this->_blockStack));
                } else {
                    array_pop($this->_blockStack);
                    $this->_metaBody .= "endif;\n";
                }
                break;

            default:
                if (preg_match('!^/(\w+)$!', $name, $m)) {
                    if (end($this->_blockStack) != $m[1]) {
                        $this->doError1('errors.tpl.tag.block.end.missing', end($this->_blockStack));
                    } else {
                        array_pop($this->_blockStack);
                        if (function_exists($fct = 'jtpl_block_'.$this->outputType.'_'.$m[1])) {
                            $res = $fct($this, false, null);
                        } elseif (function_exists($fct = 'jtpl_block_common_'.$m[1])) {
                            $res = $fct($this, false, null);
                        } else {
                            $this->doError1('errors.tpl.tag.block.begin.missing', $m[1]);
                        }
                    }
                } elseif (preg_match('/^meta_(\w+)$/', $name, $m)) {
                    if ($path = $this->_getPlugin('meta', $m[1])) {
                        $this->_parseMeta($args, $path[1]);
                        $this->_pluginPath[$path[0]] = true;
                    } else {
                        $this->doError1('errors.tpl.tag.meta.unknown', $m[1]);
                    }
                    $res = '';
                } elseif ($path = $this->_getPlugin('block', $name)) {
                    require_once $path[0];
                    $argfct = $this->_parseFinal($args, $this->_allowedAssign, array(';'), true);
                    $fct = $path[1];
                    $res = $fct($this, true, $argfct);
                    array_push($this->_blockStack, $name);
                } elseif ($path = $this->_getPlugin('cfunction', $name)) {
                    require_once $path[0];
                    $argfct = $this->_parseFinal($args, $this->_allowedAssign, array(';'), true);
                    $fct = $path[1];
                    $res = $fct($this, $argfct);
                } elseif ($path = $this->_getPlugin('function', $name)) {
                    $argfct = $this->_parseFinal($args, $this->_allowedAssign);
                    $res = $path[1].'( $t'.(trim($argfct) != '' ? ','.$argfct : '').');';
                    $this->_pluginPath[$path[0]] = true;
                } elseif (isset($this->_userFunctions[$name])) {
                    $argfct = $this->_parseFinal($args, $this->_allowedAssign);
                    $res = $this->_userFunctions[$name].'( $t'.(trim($argfct) != '' ? ','.$argfct : '').');';
                } else {
                    $this->doError1('errors.tpl.tag.function.unknown', $name);
                }
        }

        return $res;
    }
565704
public function addOption($name, $defaultValue, $necessary=false){
		$this->defValues[$name] = $defaultValue;
		if($necessary)
			$this->necessary[$name] = true;
	}