Get the help as formatted text suitable for output on the command line.

@param int $width The width of the help output.
@return string
423004
public function text($width = 72)
    {
        $parser = $this->_parser;
        $out = [];
        $description = $parser->getDescription();
        if (!empty($description)) {
            $out[] = Text::wrap($description, $width);
            $out[] = '';
        }
        $out[] = '<info>Usage:</info>';
        $out[] = $this->_generateUsage();
        $out[] = '';
        $subcommands = $parser->subcommands();
        if (!empty($subcommands)) {
            $out[] = '<info>Subcommands:</info>';
            $out[] = '';
            $max = $this->_getMaxLength($subcommands) + 2;
            foreach ($subcommands as $command) {
                $out[] = Text::wrapBlock($command->help($max), [
                    'width' => $width,
                    'indent' => str_repeat(' ', $max),
                    'indentAt' => 1
                ]);
            }
            $out[] = '';
            $out[] = sprintf('To see help on a subcommand use <info>`' . $this->_alias . ' %s [subcommand] --help`</info>', $parser->getCommand());
            $out[] = '';
        }

        $options = $parser->options();
        if (!empty($options)) {
            $max = $this->_getMaxLength($options) + 8;
            $out[] = '<info>Options:</info>';
            $out[] = '';
            foreach ($options as $option) {
                $out[] = Text::wrapBlock($option->help($max), [
                    'width' => $width,
                    'indent' => str_repeat(' ', $max),
                    'indentAt' => 1
                ]);
            }
            $out[] = '';
        }

        $arguments = $parser->arguments();
        if (!empty($arguments)) {
            $max = $this->_getMaxLength($arguments) + 2;
            $out[] = '<info>Arguments:</info>';
            $out[] = '';
            foreach ($arguments as $argument) {
                $out[] = Text::wrapBlock($argument->help($max), [
                    'width' => $width,
                    'indent' => str_repeat(' ', $max),
                    'indentAt' => 1
                ]);
            }
            $out[] = '';
        }
        $epilog = $parser->getEpilog();
        if (!empty($epilog)) {
            $out[] = Text::wrap($epilog, $width);
            $out[] = '';
        }

        return implode("\n", $out);
    }
718411
private function getCommandFromHelpCommand(HelpCommand $helpCommand)
    {
        // hackish way of retrieving the command for which help was asked
        $reflectionObject = new \ReflectionObject($helpCommand);
        $commandProperty = $reflectionObject->getProperty('command');
        $commandProperty->setAccessible(true);

        return $commandProperty->getValue($helpCommand);
    }
1095025
protected function getGitCommand(): string
    {
        return 'log --pretty=format:' .  escapeshellarg($this->format)
               . $this->abbrev
               . $this->author
               . $this->merges
               . $this->since;
    }
22054
public function displayHelp() {
        $string = 'Using: ' . $this->script . ' ' . $this->command . ' ';
        $where = array();
        foreach ($this->parameters as $Option) {
            /** @var $Option Option */
            $short = $Option->getShort();
            $long = $Option->getLong();
            $temp = '-' . $short . '|--' . $long;
            if (!$Option->isRequired()) {
                $string .= '[' . $temp . '] ';
            } else {
                $string .= $temp . ' ';
            }

            $where[] = '-' . $short . ', --' . $long . '  - ' . $Option->getDescription();
        }
        $string .= "\n";
        $string .= implode("\n", $where) . "\n";
        echo $string;
        exit(0);
    }
312395
public function getFormatted(): string
    {
        return $this->format(
            [
                $this->getTitle(),
                $this->getFirstName(),
                $this->format($this->middleNames),
                $this->getLastName(),
                $this->getSuffix(),
            ]
        );
    }
663583
public function getHtmlWidth()
    {
        if (is_string($this->width) && $this->width === self::WIDTH_AUTO) {
            return '';
        } else if (intval($this->width) > 0) {
            return $this->width . '%';
        }
        
        return $this->width;
    }
335270
public function command($command)
    {
        $attributes = AnConfig::unbox($command->getAttributes());

        if (isset($attributes['icon'])) {
            $icon = 'icon-'.$attributes['icon'];
            $command->label = '<i class="'.$icon.'"></i>&nbsp;'.$command->label;
            unset($attributes['icon']);
        }

        $html = $this->getService('com:base.template.helper.html');

        return (string) $html->tag('a', $command->label, $attributes);
    }
616908
protected function getColumnWidth(array $commands)
    {
        $width = 0;
        foreach ($commands as $command) {
            $aliasesString = $this->formatAliases($command->getAliases());
            $commandWidth = strlen($command->getName()) + strlen($aliasesString);
            $width = $commandWidth > $width ? $commandWidth : $width;
        }
        // Add the indent.
        $width += 2;
        // Accommodate tags.
        $width += strlen('<info></info>');
        return $width;
    }
30386
public function getHelp()
	{
		$help='Usage: '.$this->getCommandRunner()->getScriptName().' '.$this->getName();
		$options=$this->getOptionHelp();
		if(empty($options))
			return $help."\n";
		if(count($options)===1)
			return $help.' '.$options[0]."\n";
		$help.=" <action>\nActions:\n";
		foreach($options as $option)
			$help.='    '.$option."\n";
		return $help;
	}
39838
protected function help($command = null)
    {
        if ($command && isset(self::$help[$command])) {
            $data = self::$help[$command];
        } else {
            $data = self::$fallbackHelp;
        }

        return $this->render('system/cli/help.phtml', $data);
    }
729477
public function ScaleWidth($width)
    {
        $width = $this->castDimension($width, 'Width');
        $variant = $this->variantName(__FUNCTION__, $width);
        return $this->manipulateImage($variant, function (Image_Backend $backend) use ($width) {
            if ($backend->getWidth() === $width) {
                return $this;
            }
            return $backend->resizeByWidth($width);
        });
    }
792892
public function setWidth( $width )
    {
        $this->width = empty( $width ) ? null : (int) $width;
        return $this;
    }
210926
public function getFormattedString()
    {
        $string = (string) $this->code;

        if (null !== $this->message) {
            $string = $string . ' ' . $this->message;
        }

        return $string;
    }
1308616
public function get($format = self::TERMINAL_PNG)
    {
        $this->sendInit();
		$this->sendCommand("set terminal $format size {$this->width}{$this->unit}, {$this->width}{$this->unit}");
        fflush($this->stdout);
        $this->plot();

        // Reading data, timeout=100ms
        $result = '';
        $timeout = 100;
        do {
            stream_set_blocking($this->stdout, false);
            $data = fread($this->stdout, 128);
            $result .= $data;
            usleep(5000);
            $timeout-=5;
        } while ($timeout>0 || $data);

        return $result;
    }
420880
def get_help_width():
  """"""
  if not sys.stdout.isatty() or termios is None or fcntl is None:
    return _DEFAULT_HELP_WIDTH
  try:
    data = fcntl.ioctl(sys.stdout, termios.TIOCGWINSZ, '1234')
    columns = struct.unpack('hh', data)[1]
    # Emacs mode returns 0.
    # Here we assume that any value below 40 is unreasonable.
    if columns >= _MIN_HELP_WIDTH:
      return columns
    # Returning an int as default is fine, int(int) just return the int.
    return int(os.getenv('COLUMNS', _DEFAULT_HELP_WIDTH))

  except (TypeError, IOError, struct.error):
    return _DEFAULT_HELP_WIDTH
1222196
protected function getFormatter()
    {
        // Get formatter
        $format = LineFormatter::SIMPLE_FORMAT;
        if (!Director::is_cli()) {
            $format = "<p>$format</p>";
        }
        return Injector::inst()->createWithArgs(
            LineFormatter::class,
            array($format)
        );
    }
804910
protected function help()
    {
        
        
    	$usage = "Usage:php {$this->argv[0]} [arguments]\n";
    	$usage .= "\nArguments list:\n";
		foreach($this->inputFormat['parameters'] as $parameter){
		    $line = '';
       		if(isset($parameter['required'])){
       			if($parameter['required'] == true){
       				$line .= "Required";
       			}
       			else{
       				$line .= "Optional";
       			}
       		}
       		else{
       			//$usage .= "\t";
       		}
       		$line = str_pad($line, 15).' ';
			$line .= "--{$parameter['name']}";
       		if(isset($parameter['shortcut'])){
       			$line .= "|-{$parameter['shortcut']}";
       		}
       		$line = str_pad($line, 39).' ';
       		$line .= "{$parameter['description']}";
       		$usage .= $line."\n";
       	}
  		$this->out($usage, array('color' => 'light_blue'));
    	
        
    }