Skip to content

Commit fdf9a30

Browse files
committed
CLI update.
Changelog excerpt: - Added support for NO_COLOR.
1 parent 645241d commit fdf9a30

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

Changelog.md

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

6767
- [2025.03.29]: Reworked some of the CLI mode L10N and added a command to get information about files.
68+
69+
### v3.6.0
70+
71+
- [2025.10.07]: Added support for NO_COLOR.

src/CLI.php

Lines changed: 4 additions & 4 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: 2025.03.30).
11+
* This file: CLI handler (last modified: 2025.10.07).
1212
*/
1313

1414
namespace phpMussel\CLI;
@@ -85,7 +85,7 @@ public function __construct(\phpMussel\Core\Loader &$Loader, \phpMussel\Core\Sca
8585
});
8686

8787
/** Echo the ASCII header art and CLI-mode information. */
88-
echo "\033[0;33m" . sprintf($this->Loader->L10N->getString('cli_ln1'), PHP_VERSION, $this->Loader->ScriptVersion, $this->CLIVersion) . "\n\n" . $this->Loader->L10N->getString('cli_ln2') . "\n\n" . $this->Loader->L10N->getString('cli_ln3');
88+
echo $this->Scanner->cliColour("\033[0;33m") . sprintf($this->Loader->L10N->getString('cli_ln1'), PHP_VERSION, $this->Loader->ScriptVersion, $this->CLIVersion) . "\n\n" . $this->Loader->L10N->getString('cli_ln2') . "\n\n" . $this->Loader->L10N->getString('cli_ln3');
8989

9090
/** Open STDIN. */
9191
$Handle = fopen('php://stdin', 'rb');
@@ -98,7 +98,7 @@ public function __construct(\phpMussel\Core\Loader &$Loader, \phpMussel\Core\Sca
9898
}
9999

100100
/** Echo the CLI-mode prompt. */
101-
echo "\n\n\033[0;92m>>\033[0m ";
101+
echo "\n\n" . $this->Scanner->cliColour("\033[0;92m") . '>>' . $this->Scanner->cliColour("\033[0m") . " ";
102102

103103
/** Wait for user input. */
104104
$Clean = trim(fgets($Handle));
@@ -118,7 +118,7 @@ public function __construct(\phpMussel\Core\Loader &$Loader, \phpMussel\Core\Sca
118118
}
119119

120120
// Yellow.
121-
echo "\033[0;33m";
121+
echo $this->Scanner->cliColour("\033[0;33m");
122122

123123
/** Generate a hash signature using a file or directory. */
124124
if (substr($Command, 0, 10) === 'hash_file:') {

0 commit comments

Comments
 (0)