From bd8d09d8e8a6582fd170d6f52a99660db9447aaa Mon Sep 17 00:00:00 2001 From: yunwuxin <448901948@qq.com> Date: Mon, 9 May 2016 18:25:50 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=AD=A3=E5=91=BD=E4=BB=A4=E8=A1=8Cha?= =?UTF-8?q?sOption=E6=96=B9=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- library/think/console/Input.php | 4 ++-- library/think/console/command/Build.php | 6 ++++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/library/think/console/Input.php b/library/think/console/Input.php index c60d6082..889ee39e 100644 --- a/library/think/console/Input.php +++ b/library/think/console/Input.php @@ -361,7 +361,7 @@ class Input } return isset($this->arguments[$name]) ? $this->arguments[$name] : $this->definition->getArgument($name) - ->getDefault(); + ->getDefault(); } /** @@ -435,7 +435,7 @@ class Input */ public function hasOption($name) { - return $this->definition->hasOption($name); + return $this->definition->hasOption($name) && isset($this->options[$name]); } /** diff --git a/library/think/console/command/Build.php b/library/think/console/command/Build.php index 939e0a30..9c86060c 100644 --- a/library/think/console/command/Build.php +++ b/library/think/console/command/Build.php @@ -24,8 +24,10 @@ class Build extends Command protected function configure() { $this->setName('build') - ->setDefinition([new Option('config', null, Option::VALUE_OPTIONAL, "build.php path")]) - ->setDefinition([new Option('module', null, Option::VALUE_OPTIONAL, "module name")]) + ->setDefinition([ + new Option('config', null, Option::VALUE_OPTIONAL, "build.php path"), + new Option('module', null, Option::VALUE_OPTIONAL, "module name") + ]) ->setDescription('Build Application Dirs'); }