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'); }