Skip to content

Commit 797c26c

Browse files
committed
Add flag support.
Changelog excerpt: - Added the ability to add special, optional flags after the parameter when using the scan command, with the intent to modify scan behaviour.
1 parent b2a9710 commit 797c26c

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

Changelog.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,3 +52,6 @@ __*Why "v3.0.0" instead of "v1.0.0?"*__ Prior to phpMussel v3, the "phpMussel Co
5252

5353
#### Bugs fixed.
5454
- [2024.10.15]: Parameters containing spaces weren't being parsed correctly by the recursiveCommand method; Fixed.
55+
56+
#### Other changes.
57+
- [2024.10.15]: Added the ability to add special, optional flags after the parameter when using the scan command, with the intent to modify scan behaviour.

src/CLI.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -234,6 +234,10 @@ public function __construct(\phpMussel\Core\Loader &$Loader, \phpMussel\Core\Sca
234234
/** Scan a file or directory. */
235235
if (preg_match('~^(?:[Ss][Cc][Aa][Nn]|[Ss]|ѕ)$~', $CommandNatural)) {
236236
$TargetData = substr($Clean, strlen($Command) + 1);
237+
if (preg_match('~ --([A-Za-z]{2})$~', $TargetData, $Matches)) {
238+
$TargetData = substr($TargetData, 0, -5);
239+
$this->Loader->InstanceCache[$Matches[1]] = true;
240+
}
237241
echo "\n" . $this->Scanner->scan($TargetData) . "\n";
238242
continue;
239243
}

0 commit comments

Comments
 (0)