mirror of
https://github.com/lkeme/BiliHelper-personal.git
synced 2025-12-19 09:30:10 +08:00
[fix] Command argv parse error
This commit is contained in:
parent
5b814434a8
commit
924c71ad9e
@ -63,6 +63,10 @@ final class DebugCommand extends Command
|
|||||||
{
|
{
|
||||||
Log::info("执行 $this->desc");
|
Log::info("执行 $this->desc");
|
||||||
//
|
//
|
||||||
|
if (is_null($this->values()['plugin']) || $this->values()['plugins']) {
|
||||||
|
failExit('发生错误,未加载插件');
|
||||||
|
}
|
||||||
|
//
|
||||||
$p = $this->values()['plugin'];
|
$p = $this->values()['plugin'];
|
||||||
if (is_null($p)) {
|
if (is_null($p)) {
|
||||||
$temp = $this->values()['plugins'];
|
$temp = $this->values()['plugins'];
|
||||||
@ -76,7 +80,7 @@ final class DebugCommand extends Command
|
|||||||
//
|
//
|
||||||
$plugins = Plugin::getPlugins();
|
$plugins = Plugin::getPlugins();
|
||||||
foreach ($plugins as $plugin) {
|
foreach ($plugins as $plugin) {
|
||||||
if(!in_array($plugin['hook'],$pp)){
|
if (!in_array($plugin['hook'], $pp)) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
Task::addTask($plugin['hook'], null);
|
Task::addTask($plugin['hook'], null);
|
||||||
@ -85,5 +89,4 @@ final class DebugCommand extends Command
|
|||||||
Task::execTasks();
|
Task::execTasks();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}
|
||||||
}
|
|
||||||
|
|||||||
@ -86,6 +86,18 @@ LOGO;
|
|||||||
return $filename;
|
return $filename;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param array $argv
|
||||||
|
* @return array
|
||||||
|
*/
|
||||||
|
protected function transArgv(array $argv): array
|
||||||
|
{
|
||||||
|
if (!str_contains($argv[1], ':')) {
|
||||||
|
unset($argv[1]);
|
||||||
|
}
|
||||||
|
return array_values($argv);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
@ -98,7 +110,7 @@ LOGO;
|
|||||||
->add(new RestoreCommand(), 'm:r') // 模式3
|
->add(new RestoreCommand(), 'm:r') // 模式3
|
||||||
->add(new DebugCommand(), 'm:d') // 模式4
|
->add(new DebugCommand(), 'm:d') // 模式4
|
||||||
->logo($this->logo)
|
->logo($this->logo)
|
||||||
->handle($this->argv);
|
->handle($this->transArgv($this->argv));
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -112,7 +112,7 @@ class Common
|
|||||||
* @param int $length
|
* @param int $length
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
public static function randString(int $length):string
|
public static function randString(int $length): string
|
||||||
{
|
{
|
||||||
// $output='';
|
// $output='';
|
||||||
// for ($a = 0; $a<$length; $a++) {
|
// for ($a = 0; $a<$length; $a++) {
|
||||||
@ -126,4 +126,4 @@ class Common
|
|||||||
return $key;
|
return $key;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user