diff --git a/src/Symfony/Components/Console/Input/Input.php b/src/Symfony/Components/Console/Input/Input.php index a203313dd103..9e9e5f48263c 100644 --- a/src/Symfony/Components/Console/Input/Input.php +++ b/src/Symfony/Components/Console/Input/Input.php @@ -129,6 +129,18 @@ public function setArgument($name, $value) $this->arguments[$name] = $value; } + /** + * Returns true if an InputArgument object exists by name or position. + * + * @param string|integer $name The InputArgument name or position + * + * @return Boolean true if the InputArgument object exists, false otherwise + */ + public function hasArgument($name) + { + return $this->definition->hasArgument($name); + } + /** * Returns the options values. * @@ -171,4 +183,16 @@ public function setOption($name, $value) $this->options[$name] = $value; } + + /** + * Returns true if an InputOption object exists by name. + * + * @param string $name The InputOption name + * + * @return Boolean true if the InputOption object exists, false otherwise + */ + public function hasOption($name) + { + return $this->definition->hasOption($name); + } }