From 9290303e80801a31569386c1a030ca6ed7dd34b5 Mon Sep 17 00:00:00 2001 From: Aleksander Machniak Date: Tue, 20 Nov 2012 10:37:13 +0100 Subject: Move prompt_silent() and get_opt() to rcube_utils class --- bin/moduserprefs.sh | 2 +- bin/msgexport.sh | 5 +++-- bin/msgimport.sh | 5 +++-- bin/update.sh | 2 +- 4 files changed, 8 insertions(+), 6 deletions(-) (limited to 'bin') diff --git a/bin/moduserprefs.sh b/bin/moduserprefs.sh index 79baf1ea9..a8fc3f655 100755 --- a/bin/moduserprefs.sh +++ b/bin/moduserprefs.sh @@ -31,7 +31,7 @@ function print_usage() // get arguments -$args = get_opt(array('u' => 'user', 'd' => 'delete')); +$args = rcube_utils:get_opt(array('u' => 'user', 'd' => 'delete')); if ($_SERVER['argv'][1] == 'help') { print_usage(); diff --git a/bin/msgexport.sh b/bin/msgexport.sh index e6c180188..e98e5fee2 100755 --- a/bin/msgexport.sh +++ b/bin/msgexport.sh @@ -71,7 +71,8 @@ function export_mailbox($mbox, $filename) // get arguments -$args = get_opt(array('h' => 'host', 'u' => 'user', 'p' => 'pass', 'm' => 'mbox', 'f' => 'file')) + array('host' => 'localhost', 'mbox' => 'INBOX'); +$opts = array('h' => 'host', 'u' => 'user', 'p' => 'pass', 'm' => 'mbox', 'f' => 'file'); +$args = rcube_utils::get_opt($opts) + array('host' => 'localhost', 'mbox' => 'INBOX'); if ($_SERVER['argv'][1] == 'help') { @@ -93,7 +94,7 @@ if (empty($args['user'])) } // prompt for password -$args['pass'] = prompt_silent("Password: "); +$args['pass'] = rcube_utils::prompt_silent("Password: "); // parse $host URL diff --git a/bin/msgimport.sh b/bin/msgimport.sh index 845c585e1..41bcd7e53 100755 --- a/bin/msgimport.sh +++ b/bin/msgimport.sh @@ -17,7 +17,8 @@ function print_usage() // get arguments -$args = get_opt(array('h' => 'host', 'u' => 'user', 'p' => 'pass', 'm' => 'mbox', 'f' => 'file')) + array('host' => 'localhost', 'mbox' => 'INBOX'); +$opts = array('h' => 'host', 'u' => 'user', 'p' => 'pass', 'm' => 'mbox', 'f' => 'file'); +$args = rcube_utils::get_opt($opts) + array('host' => 'localhost', 'mbox' => 'INBOX'); if ($_SERVER['argv'][1] == 'help') { @@ -47,7 +48,7 @@ if (empty($args['user'])) // prompt for password if (empty($args['pass'])) { - $args['pass'] = prompt_silent("Password: "); + $args['pass'] = rcube_utils::prompt_silent("Password: "); } // parse $host URL diff --git a/bin/update.sh b/bin/update.sh index f141fa685..59aa596dd 100755 --- a/bin/update.sh +++ b/bin/update.sh @@ -25,7 +25,7 @@ require_once INSTALL_PATH . 'program/include/clisetup.php'; require_once INSTALL_PATH . 'installer/rcube_install.php'; // get arguments -$opts = get_opt(array('v' => 'version')); +$opts = rcube_utils::get_opt(array('v' => 'version')); // ask user if no version is specified if (!$opts['version']) { -- cgit v1.2.3