Skip to content

Commit

Permalink
up: update dep toolkit/pflag to 2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
inhere committed Dec 9, 2021
1 parent be11933 commit ae9e9f6
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@
}
],
"require": {
"php": ">=8.0.1",
"php": ">8.0.1",
"toolkit/cli-utils": "~2.0",
"toolkit/fsutil": "~2.0",
"toolkit/pflag": "~1.0",
"toolkit/pflag": "~2.0",
"toolkit/stdlib": "^2.0",
"toolkit/sys-utils": "~2.0"
},
Expand Down
10 changes: 8 additions & 2 deletions src/AbstractApplication.php
Original file line number Diff line number Diff line change
Expand Up @@ -261,8 +261,14 @@ protected function beforeRun(): bool
$firstArg = array_shift($remainArgs);

if (!Helper::isValidCmdPath($firstArg)) {
$this->output->liteError('input an invalid command name');
$this->showCommandList();
$evtName = ConsoleEvent::ON_NOT_FOUND;
if (true === $this->fire($evtName, $firstArg, $this)) {
$this->debugf('user custom handle the invalid command: %s, event: %s', $firstArg, $evtName);
} else {
$this->output->liteError("input an invalid command name: $firstArg");
$this->showCommandList();
}

return false;
}

Expand Down

0 comments on commit ae9e9f6

Please sign in to comment.