Skip to content

Commit 4cc11f1

Browse files
committed
New feature: Colours.
1 parent 35ba844 commit 4cc11f1

File tree

3 files changed

+11
-4
lines changed

3 files changed

+11
-4
lines changed

Changelog.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,3 +29,7 @@ __*Why "v3.0.0" instead of "v1.0.0?"*__ Prior to phpMussel v3, the "phpMussel Co
2929
### v3.1.5
3030

3131
[2023.04.30; Maikuolan]: Added L10N for Bulgarian, Czech, and Punjabi.
32+
33+
### v3.2.0
34+
35+
[2023.09.04; New Feature; Maikuolan]: Added colouration to phpMussel's CLI mode.

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
},
1313
"require": {
1414
"php": ">=7.2.0 !=7.4.0",
15-
"phpmussel/core": "^3.3.2",
15+
"phpmussel/core": "^3.4.1",
1616
"ext-pcre": "*"
1717
},
1818
"autoload": {

src/CLI.php

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
* License: GNU/GPLv2
99
* @see LICENSE.txt
1010
*
11-
* This file: CLI handler (last modified: 2022.08.23).
11+
* This file: CLI handler (last modified: 2023.09.04).
1212
*/
1313

1414
namespace phpMussel\CLI;
@@ -80,7 +80,7 @@ public function __construct(\phpMussel\Core\Loader &$Loader, \phpMussel\Core\Sca
8080
});
8181

8282
/** Echo the ASCII header art and CLI-mode information. */
83-
echo $this->Loader->L10N->getString('cli_ln1') . "\n" . $this->Loader->L10N->getString('cli_ln2') . "\n\n" . $this->Loader->L10N->getString('cli_ln3');
83+
echo "\033[0;33m" . $this->Loader->L10N->getString('cli_ln1') . "\n" . $this->Loader->L10N->getString('cli_ln2') . "\n\n" . $this->Loader->L10N->getString('cli_ln3');
8484

8585
/** Open STDIN. */
8686
$Handle = fopen('php://stdin', 'rb');
@@ -93,7 +93,7 @@ public function __construct(\phpMussel\Core\Loader &$Loader, \phpMussel\Core\Sca
9393
}
9494

9595
/** Echo the CLI-mode prompt. */
96-
echo "\n\n>> ";
96+
echo "\n\n\033[0;92m>>\033[0m ";
9797

9898
/** Wait for user input. */
9999
$Clean = trim(fgets($Handle));
@@ -112,6 +112,9 @@ public function __construct(\phpMussel\Core\Loader &$Loader, \phpMussel\Core\Sca
112112
break;
113113
}
114114

115+
// Yellow.
116+
echo "\033[0;33m";
117+
115118
/** Generate a hash signature using a file or directory. */
116119
if (substr($Command, 0, 10) === 'hash_file:') {
117120
$this->LastAlgo = substr($Command, 10);

0 commit comments

Comments
 (0)