scripts/inflector.php:

- remove unused function variable()

scripts/postfixadmin-cli.php, scripts/shells/shell.php:
- replace user-visible "cake" with "postfixadmin-cli"

scripts/shells/mailbox.php:
- fix/update help text



git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1546 a1433add-5e2c-0410-b055-b7f2511e0802
pull/2/head
Christian Boltz 11 years ago
parent 4fb4ee264a
commit 4785426269

@ -53,19 +53,5 @@ class Inflector {
$replace = strtolower(preg_replace('/(?<=\\w)([A-Z])/', '_\\1', $camelCasedWord));
return $replace;
}
/**
* Returns camelBacked version of a string.
*
* @param string $string
* @return string in variable form
* @access public
* @static
*/
public static function variable($string) {
$string = Inflector::camelize(Inflector::underscore($string));
$replace = strtolower(substr($string, 0, 1));
$variable = preg_replace('/\\w/', $replace, $string, 1);
return $variable;
}
}

@ -338,7 +338,7 @@ class PostfixAdmin {
$shell->startup();
$shell->{$command}();
} else {
$this->stderr("Unknown {$this->shellName} command '$command'.\nFor usage, try 'cake {$this->shell} help'.\n\n");
$this->stderr("Unknown {$this->shellName} command '$command'.\nFor usage, try 'postfixadmin-cli {$this->shell} help'.\n\n");
}
} else {
$this->stderr('Class '.$this->shellClass.' could not be loaded');

@ -20,7 +20,7 @@ class PostfixAdminMailbox extends Shell {
* @access public
*/
function help() {
$head = "Usage: postfixadmin-cli mailbox <task> [<address>] [] [-m <method>]\n";
$head = "Usage: postfixadmin-cli mailbox <task> [<address>] [] [--<option> <value>]\n";
$head .= "-----------------------------------------------\n";
$head .= "Parameters:\n\n";
@ -33,7 +33,7 @@ class PostfixAdminMailbox extends Shell {
"\t\t".sprintf("%-20s %s", "delete: ", "Deletes a mailbox")."\n".
"\t\t".sprintf("%-20s %s", "password: ", "Changes the PW for a mailbox.")."\n",
'address' => "\t[<address>]\n" .
"\t\tA CakePHP core class name (e.g: Component, HtmlHelper).\n",
"\t\tMail address\n",
);
$this->out($head);

@ -348,7 +348,7 @@ if ( empty($this->params['q'] ) ) {
*/
function help() {
if ($this->command != null) {
$this->err("Unknown {$this->name} command '$this->command'.\nFor usage, try 'cake {$this->shell} help'.\n\n");
$this->err("Unknown {$this->name} command '$this->command'.\nFor usage, try 'postfixadmin-cli {$this->shell} help'.\n\n");
} else {
$this->Dispatch->help();
}

Loading…
Cancel
Save