autoframe/cli-tools

Cli Prompt, Text styles Bold, Italic, Blink, Underline, Text colors, Background colors...

1.0.0 2024-04-26 19:51 UTC

This package is auto-updated.

Last update: 2024-11-26 21:19:38 UTC


README

License: The 3-Clause BSD License Packagist Version Downloads

Cli Prompt, Text styles Bold, Italic, Blink, Underline, Text colors, Background colors...

Examples https://prnt.sc/-ns-4QpB3NYl

Examples

`AfrCliPromptMenu`

use Autoframe\CliTools\AfrCliPromptMenu;

        if (!AfrCliPromptMenu::insideCli()) {
            echo 'The script does not run inside CLI!' . PHP_EOL;
            return;
        }

        $options = [
            'Mercedes',
            'Audi',
            'Porsche',
        ];

        $user_choice = AfrCliPromptMenu::promptMenu(
            "Select your dream car",
            $options,
            $options[1]
        );
        print PHP_EOL . "You chose: '$user_choice'\n";
`AfrCliTextColors`

use Autoframe\CliTools\AfrCliTextColors;

AfrCliTextColors::getInstance()->
        bgBlueLight('Hello ')->
        bgDefaultAllColorStyle( 'my ')->
        styleBold(true)->
        textAppend('bold ')->
        colorGreen('World! ')->
        styleBold(false)->
        bgMagenta('How ')->
        styleInvert(true)->
        textAppend('Inverted ')->
        styleInvert(false)->
        bgCyanLight()->
        colorYellowLight('is the ')->
        styleItalic(true)->
        colorRed('rainbow?')->
        styleDefaultAllBgColor()->
        textPrint();