From: Chuck Hagenbuch Date: Tue, 7 Apr 2009 19:52:45 +0000 (-0400) Subject: abort if there is no command name (positional argument) to the cli controller X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=a0e35e2833e88acedcbedd5e3de45b343e9d0ac8;p=horde.git abort if there is no command name (positional argument) to the cli controller --- diff --git a/framework/Controller/lib/Horde/Controller/Request/Cli.php b/framework/Controller/lib/Horde/Controller/Request/Cli.php index 7f46a59cd..b26a89e1d 100644 --- a/framework/Controller/lib/Horde/Controller/Request/Cli.php +++ b/framework/Controller/lib/Horde/Controller/Request/Cli.php @@ -36,10 +36,12 @@ class Horde_Controller_Request_Cli extends Horde_Controller_Request_Base { parent::__construct($options); - $parser = new Horde_Argv_Parser(array('allowUnknownArgs' => true)); + $parser = new Horde_Argv_Parser(array( + 'allowUnknownArgs' => true, + )); list($this->_argv, $args) = $parser->parseArgs(); - if (count($args) != 1) { - throw new Horde_Controller_Exception("unknown command: " . implode(' ', $args)); + if (!count($args)) { + throw new Horde_Controller_Exception('unknown command: ' . implode(' ', $args)); } $this->_path = $args[0]; }