From bd911ba8143f07fa4f14b682ddcd559a69a208e8 Mon Sep 17 00:00:00 2001 From: thomascube Date: Wed, 29 Sep 2010 08:30:56 +0000 Subject: Pool some code for command line tools; avoid displaying password on shell (#1486947); fix msgexport now using the new imap wrapper --- program/include/clisetup.php | 90 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 90 insertions(+) create mode 100644 program/include/clisetup.php (limited to 'program/include/clisetup.php') diff --git a/program/include/clisetup.php b/program/include/clisetup.php new file mode 100644 index 000000000..fbea98063 --- /dev/null +++ b/program/include/clisetup.php @@ -0,0 +1,90 @@ + | + +-----------------------------------------------------------------------+ + + $Id$ + +*/ + +if (php_sapi_name() != 'cli') { + die('Not on the "shell" (php-cli).'); +} + +require_once 'iniset.php'; + + +/** + * Parse commandline arguments into a hash array + */ +function get_opt($aliases=array()) +{ + $args = array(); + for ($i=1; $i \ No newline at end of file -- cgit v1.2.3