From 68280cfe7e6a7c4acfdbc83df68d9779c048ca0f Mon Sep 17 00:00:00 2001 From: jerry Date: Thu, 25 Mar 2021 16:50:32 +0800 Subject: [PATCH] fix init command --- src/ZM/Command/InitCommand.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/ZM/Command/InitCommand.php b/src/ZM/Command/InitCommand.php index 4701a0f7..8ed99786 100644 --- a/src/ZM/Command/InitCommand.php +++ b/src/ZM/Command/InitCommand.php @@ -6,6 +6,7 @@ namespace ZM\Command; use Phar; use Symfony\Component\Console\Command\Command; use Symfony\Component\Console\Input\InputInterface; +use Symfony\Component\Console\Input\InputOption; use Symfony\Component\Console\Output\OutputInterface; class InitCommand extends Command @@ -26,7 +27,9 @@ class InitCommand extends Command protected function configure() { $this->setDescription("Initialize framework starter | 初始化框架运行的基础文件"); - $this->addOption("force", 'F', null, "强制重制,覆盖现有文件"); + $this->setDefinition([ + new InputOption("force", "F", null, "强制重制,覆盖现有文件") + ]); $this->setHelp("此命令将会解压以下文件到项目的根目录:\n" . implode("\n", $this->getExtractFiles())); // ... }