setPad example



        $length = max(array_map('strlen', array_keys($commands)));

        ksort($groups);

        // Display it all...         foreach ($groups as $group => $commands) {
            CLI::write($group, 'yellow');

            foreach ($commands as $name => $command) {
                $name   = $this->setPad($name$length, 2, 2);
                $output = CLI::color($name, 'green');

                if (isset($command['description'])) {
                    $output .= CLI::wrap($command['description'], 125, strlen($name));
                }

                CLI::write($output);
            }

            if ($group !== array_key_last($groups)) {
                CLI::newLine();
            }
if (empty($this->usage)) {
            $usage = $this->usage;
        } else {
            $usage = $this->name;

            if (empty($this->arguments)) {
                $usage .= ' [arguments]';
            }
        }

        CLI::write($this->setPad($usage, 0, 0, 2));

        if (empty($this->description)) {
            CLI::newLine();
            CLI::write(lang('CLI.helpDescription'), 'yellow');
            CLI::write($this->setPad($this->description, 0, 0, 2));
        }

        if (empty($this->arguments)) {
            CLI::newLine();
            CLI::write(lang('CLI.helpArguments'), 'yellow');
            $length = max(array_map('strlen', array_keys($this->arguments)));

            
Home | Imprint | This part of the site doesn't use cookies.