Skip to content

Commit

Permalink
Add flag support.
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
Maikuolan committed Oct 15, 2024
1 parent b2a9710 commit 797c26c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
3 changes: 3 additions & 0 deletions Changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,3 +52,6 @@ __*Why "v3.0.0" instead of "v1.0.0?"*__ Prior to phpMussel v3, the "phpMussel Co

#### Bugs fixed.
- [2024.10.15]: Parameters containing spaces weren't being parsed correctly by the recursiveCommand method; Fixed.

#### Other changes.
- [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.
4 changes: 4 additions & 0 deletions src/CLI.php
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,10 @@ public function __construct(\phpMussel\Core\Loader &$Loader, \phpMussel\Core\Sca
/** Scan a file or directory. */
if (preg_match('~^(?:[Ss][Cc][Aa][Nn]|[Ss]|ѕ)$~', $CommandNatural)) {
$TargetData = substr($Clean, strlen($Command) + 1);
if (preg_match('~ --([A-Za-z]{2})$~', $TargetData, $Matches)) {
$TargetData = substr($TargetData, 0, -5);
$this->Loader->InstanceCache[$Matches[1]] = true;
}
echo "\n" . $this->Scanner->scan($TargetData) . "\n";
continue;
}
Expand Down

0 comments on commit 797c26c

Please sign in to comment.