Skip to content

Commit ae9e9f6

Browse files
committed
up: update dep toolkit/pflag to 2.0
1 parent be11933 commit ae9e9f6

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

composer.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,10 @@
2222
}
2323
],
2424
"require": {
25-
"php": ">=8.0.1",
25+
"php": ">8.0.1",
2626
"toolkit/cli-utils": "~2.0",
2727
"toolkit/fsutil": "~2.0",
28-
"toolkit/pflag": "~1.0",
28+
"toolkit/pflag": "~2.0",
2929
"toolkit/stdlib": "^2.0",
3030
"toolkit/sys-utils": "~2.0"
3131
},

src/AbstractApplication.php

+8-2
Original file line numberDiff line numberDiff line change
@@ -261,8 +261,14 @@ protected function beforeRun(): bool
261261
$firstArg = array_shift($remainArgs);
262262

263263
if (!Helper::isValidCmdPath($firstArg)) {
264-
$this->output->liteError('input an invalid command name');
265-
$this->showCommandList();
264+
$evtName = ConsoleEvent::ON_NOT_FOUND;
265+
if (true === $this->fire($evtName, $firstArg, $this)) {
266+
$this->debugf('user custom handle the invalid command: %s, event: %s', $firstArg, $evtName);
267+
} else {
268+
$this->output->liteError("input an invalid command name: $firstArg");
269+
$this->showCommandList();
270+
}
271+
266272
return false;
267273
}
268274

0 commit comments

Comments
 (0)