src/ParameterParser/ParameterCluster.php
public function printFullUsage(
        $applicationName,
        $description = null,
        $applicationVersion = null,
        $showRequiredFirst = true,
        $customBinary = null,
        $customScript = null,
        $columnPadding = 5,
        $usageStyle = null
    ) {
        // Create Ansi Instance
        $ansi = new \Bramus\Ansi\Ansi();

        $ansi->color([SGR::COLOR_FG_BLUE_BRIGHT])
             ->bold()
             ->text(PHP_EOL.$applicationName)
             ->noStyle();

        $ansi->text(
            ($applicationVersion !== null ? ' '.$applicationVersion : '').PHP_EOL
        );
        echo PHP_EOL;

        if ($description != null) {
            $ansi->color([SGR::COLOR_FG_BLUE_BRIGHT])
                 ->bold()
                 ->text('Description:')
                 ->noStyle();
            echo PHP_EOL.PHP_EOL."\t".$description.PHP_EOL.PHP_EOL;
        }

        $ansi->color([SGR::COLOR_FG_BLUE_BRIGHT])
                 ->bold()
                 ->text('Usage:')
                 ->noStyle();
        echo PHP_EOL.PHP_EOL."\t".
             $this->getUsage(
                 $showRequiredFirst,
                 $customBinary,
                 $customScript
             ).PHP_EOL;
        echo PHP_EOL;

        $parameterCount = 0;
        $values = $usageStyle == null ? FullUsageStyle::all() : $usageStyle;

        foreach ($this->prefixes as $prefix => $parameters) {
            foreach ($parameters as $parameter) {
                if ($parameter->parent === null) {
                    $parameterCount += 1;
                    foreach ($values as $mappedValueName => $mappedValue) {
                        $nVal = $mappedValue['fetch']($parameter);
                        $nValSize = strlen($nVal);
                        if (
                            $nValSize +
                            $columnPadding
                            > $values[$mappedValueName]['longest']
                        ) {
                            $values[$mappedValueName]['longest'] =
                                $nValSize +
                                $columnPadding;
                        }

                        $values[$mappedValueName]['values'][] = $nVal;
                    }
                }
            }
        }

        $ansi->color([SGR::COLOR_FG_BLUE_BRIGHT])
                 ->bold()
                 ->text('Parameters:')
                 ->noStyle();
        echo PHP_EOL.PHP_EOL;

        $headerFormat = "\t";
        $columnNames = [];

        $parameterFormat = '';
        $parameterValues = [];

        foreach ($values as $mappedValueName => $mappedValue) {
            $headerFormat .= '%-'.$mappedValue['longest'].'s ';
            $columnNames[] = ucwords($mappedValueName);
        }

        for ($i = 0; $i < $parameterCount; $i++) {
            $newFormat = "\t";
            foreach ($values as $mappedValueName => $mappedValue) {
                $newFormat .= '%-'.$mappedValue['longest'].'s ';
                $parameterValues[] = $mappedValue['values'][$i];
            }
            $newFormat .= PHP_EOL;
            $parameterFormat .= $newFormat;
        }

        vprintf($headerFormat.PHP_EOL, $columnNames);
        vprintf($parameterFormat.PHP_EOL, $parameterValues);
    }
public function printFullUsage(
        $applicationName,
        $description = null,
        $applicationVersion = null,
        $showRequiredFirst = true,
        $customBinary = null,
        $customScript = null,
        $columnPadding = 5,
        $usageStyle = null
    ) {
        // Create Ansi Instance
        $ansi = new \Bramus\Ansi\Ansi();

        $ansi->color([SGR::COLOR_FG_BLUE_BRIGHT])
             ->bold()
             ->text(PHP_EOL.$applicationName)
             ->noStyle();

        $ansi->text(
            ($applicationVersion !== null ? ' '.$applicationVersion : '').PHP_EOL
        );
        echo PHP_EOL;

        if ($description != null) {
            $ansi->color([SGR::COLOR_FG_BLUE_BRIGHT])
                 ->bold()
                 ->text('Description:')
                 ->noStyle();
            echo PHP_EOL.PHP_EOL."\t".$description.PHP_EOL.PHP_EOL;
        }

        $ansi->color([SGR::COLOR_FG_BLUE_BRIGHT])
                 ->bold()
                 ->text('Usage:')
                 ->noStyle();
        echo PHP_EOL.PHP_EOL."\t".
             $this->getUsage(
                 $showRequiredFirst,
                 $customBinary,
                 $customScript
             ).PHP_EOL;
        echo PHP_EOL;

        $parameterCount = 0;
        $values = $usageStyle == null ? FullUsageStyle::all() : $usageStyle;

        foreach ($this->prefixes as $prefix => $parameters) {
            foreach ($parameters as $parameter) {
                if ($parameter->parent === null) {
                    $parameterCount += 1;
                    foreach ($values as $mappedValueName => $mappedValue) {
                        $nVal = $mappedValue['fetch']($parameter);
                        $nValSize = strlen($nVal);
                        if (
                            $nValSize +
                            $columnPadding
                            > $values[$mappedValueName]['longest']
                        ) {
                            $values[$mappedValueName]['longest'] =
                                $nValSize +
                                $columnPadding;
                        }

                        $values[$mappedValueName]['values'][] = $nVal;
                    }
                }
            }
        }

        $ansi->color([SGR::COLOR_FG_BLUE_BRIGHT])
                 ->bold()
                 ->text('Parameters:')
                 ->noStyle();
        echo PHP_EOL.PHP_EOL;

        $headerFormat = "\t";
        $columnNames = [];

        $parameterFormat = '';
        $parameterValues = [];

        foreach ($values as $mappedValueName => $mappedValue) {
            $headerFormat .= '%-'.$mappedValue['longest'].'s ';
            $columnNames[] = ucwords($mappedValueName);
        }

        for ($i = 0; $i < $parameterCount; $i++) {
            $newFormat = "\t";
            foreach ($values as $mappedValueName => $mappedValue) {
                $newFormat .= '%-'.$mappedValue['longest'].'s ';
                $parameterValues[] = $mappedValue['values'][$i];
            }
            $newFormat .= PHP_EOL;
            $parameterFormat .= $newFormat;
        }

        vprintf($headerFormat.PHP_EOL, $columnNames);
        vprintf($parameterFormat.PHP_EOL, $parameterValues);
    }
Print the full usage along with each commands
individual usage and descripition.

@param string $applicationName
@param string $description
@param string $applicationVersion
@param bool   $showRequiredFirst
@param string $customBinary
@param string $customScript
@param int    $columnPadding
@param array  $fullUsageStyle