Add "commands" cli command
authorTim Düsterhus <duesterhus@woltlab.com>
Sun, 10 Nov 2013 14:34:22 +0000 (15:34 +0100)
committerTim Düsterhus <duesterhus@woltlab.com>
Sun, 10 Nov 2013 14:34:22 +0000 (15:34 +0100)
See #1561

wcfsetup/install/files/lib/system/cli/command/CommandsCLICommand.class.php [new file with mode: 0644]

diff --git a/wcfsetup/install/files/lib/system/cli/command/CommandsCLICommand.class.php b/wcfsetup/install/files/lib/system/cli/command/CommandsCLICommand.class.php
new file mode 100644 (file)
index 0000000..88579d6
--- /dev/null
@@ -0,0 +1,30 @@
+<?php
+namespace wcf\system\cli\command;
+use wcf\system\CLIWCF;
+use wcf\util\CLIUtil;
+
+/**
+ * Lists available commands.
+ * 
+ * @author     Tim Duesterhus
+ * @copyright  2001-2013 WoltLab GmbH
+ * @license    GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
+ * @package    com.woltlab.wcf
+ * @subpackage system.cli.command
+ * @category   Community Framework
+ */
+class CommandsCLICommand implements ICLICommand {
+       /**
+        * @see \wcf\system\cli\command\ICLICommand::execute()
+        */
+       public function execute(array $parameters) {
+               CLIWCF::getReader()->println(CLIUtil::generateList(array_keys(CLICommandHandler::getCommands())));
+       }
+       
+       /**
+        * @see \wcf\system\cli\command\ICLICommand::canAccess()
+        */
+       public function canAccess() {
+               return true;
+       }
+}