From ce64f2fa6e111b481e5db9e7045c169f08c4f632 Mon Sep 17 00:00:00 2001 From: mark_story Date: Sat, 1 Aug 2009 21:23:06 -0400 Subject: [PATCH] reformatting help() to fit on 80 col displays. --- cake/console/libs/acl.php | 111 ++++++++++++++++++++++---------------- 1 file changed, 64 insertions(+), 47 deletions(-) diff --git a/cake/console/libs/acl.php b/cake/console/libs/acl.php index c94a1cef8..18d73fe7c 100644 --- a/cake/console/libs/acl.php +++ b/cake/console/libs/acl.php @@ -362,64 +362,81 @@ class AclShell extends Shell { * @access public */ function help() { - $head = __("Usage: cake acl ...", true) . "\n"; + $head = "-----------------------------------------------\n"; + $head .= __("Usage: cake acl ...", true) . "\n"; $head .= "-----------------------------------------------\n"; - $head .= __("Commands:", true) . "\n\n"; + $head .= __("Commands:", true) . "\n"; $commands = array( - 'create' => "\tcreate aro|aco \n" . - "\t\t" . __("Creates a new ACL object under the parent specified by , an id/alias.", true) . "\n" . - "\t\t" . __("The and references can be in one of the following formats:", true) . "\n" . - "\t\t\t- " . __(". - The node will be bound to a specific record of the given model", true) . "\n" . - "\t\t\t- " . __(" - The node will be given a string alias (or path, in the case of ),", true) . "\n" . - "\t\t\t " . __("i.e. 'John'. When used with , this takes the form of an alias path,", true) . "\n" . - "\t\t\t " . __("i.e. //.", true) . "\n" . - "\t\t" . __("To add a node at the root level, enter 'root' or '/' as the parameter.", true) . "\n", + 'create' => "create aro|aco \n" . + "\t" . __("Creates a new ACL object under the parent", true) . "\n" . + "\t" . __("specified by , an id/alias.", true) . "\n" . + "\t" . __("The and references can be", true) . "\n" . + "\t" . __("in one of the following formats:", true) . "\n\n" . + "\t\t- " . __(". - The node will be bound to a", true) . "\n" . + "\t\t" . __("specific record of the given model.", true) . "\n\n" . + "\t\t- " . __(" - The node will be given a string alias,", true) . "\n" . + "\t\t" . __(" (or path, in the case of )", true) . "\n" . + "\t\t " . __("i.e. 'John'. When used with ,", true) . "\n" . + "\t\t" . __("this takes the form of an alias path,", true) . "\n" . + "\t\t " . __("i.e. //.", true) . "\n\n" . + "\t" . __("To add a node at the root level,", true) . "\n" . + "\t" . __("enter 'root' or '/' as the parameter.", true) . "\n", - 'delete' => "\tdelete aro|aco \n" . - "\t\t" . __("Deletes the ACL object with the given reference (see 'create' for info on node references).", true) . "\n", + 'delete' => "delete aro|aco \n" . + "\t" . __("Deletes the ACL object with the given reference", true) . "\n" . + "\t" . __("For more detailed parameter usage info,", true) . "\n" . + "\t" . __("see help for the 'create' command.", true), - 'setparent' => "\tsetParent aro|aco \n" . - "\t\t" . __("Moves the ACL object specified by beneath the parent ACL object specified by .", true) . "\n" . - "\t\t" . __("To identify the node and parent, use the row id.", true) . "\n", + 'setparent' => "setParent aro|aco \n" . + "\t" . __("Moves the ACL object specified by beneath", true) . "\n" . + "\t" . __("the parent ACL object specified by .", true) . "\n" . + "\t" . __("For more detailed parameter usage info,", true) . "\n" . + "\t" . __("see help for the 'create' command.", true), - 'getpath' => "\tgetPath aro|aco \n" . - "\t\t" . __("Returns the path to the ACL object specified by . This command", true) . "\n" . - "\t\t" . __("is useful in determining the inhertiance of permissions for a certain", true) . "\n" . - "\t\t" . __("object in the tree.", true) . "\n" . - "\t\t" . __("For more detailed parameter usage info, see help for the 'create' command.", true) . "\n", + 'getpath' => "getPath aro|aco \n" . + "\t" . __("Returns the path to the ACL object specified by . This command", true) . "\n" . + "\t" . __("is useful in determining the inhertiance of permissions for a certain", true) . "\n" . + "\t" . __("object in the tree.", true) . "\n" . + "\t" . __("For more detailed parameter usage info,", true) . "\n" . + "\t" . __("see help for the 'create' command.", true), - 'check' => "\tcheck [] " . __("or", true) . " all\n" . - "\t\t" . __("Use this command to check ACL permissions.", true) . "\n" . - "\t\t" . __("For more detailed parameter usage info, see help for the 'create' command.", true) . "\n", + 'check' => "check [] " . __("or", true) . " all\n" . + "\t" . __("Use this command to check ACL permissions.", true) . "\n" . + "\t" . __("For more detailed parameter usage info,", true) . "\n" . + "\t" . __("see help for the 'create' command.", true), - 'grant' => "\tgrant [] " . __("or", true) . " all\n" . - "\t\t" . __("Use this command to grant ACL permissions. Once executed, the ARO", true) . "\n" . - "\t\t" . __("specified (and its children, if any) will have ALLOW access to the", true) . "\n" . - "\t\t" . __("specified ACO action (and the ACO's children, if any).", true) . "\n" . - "\t\t" . __("For more detailed parameter usage info, see help for the 'create' command.", true) . "\n", + 'grant' => "grant [] " . __("or", true) . " all\n" . + "\t" . __("Use this command to grant ACL permissions. Once executed, the ARO", true) . "\n" . + "\t" . __("specified (and its children, if any) will have ALLOW access to the", true) . "\n" . + "\t" . __("specified ACO action (and the ACO's children, if any).", true) . "\n" . + "\t" . __("For more detailed parameter usage info,", true) . "\n" . + "\t" . __("see help for the 'create' command.", true), - 'deny' => "\tdeny []" . __("or", true) . " all\n" . - "\t\t" . __("Use this command to deny ACL permissions. Once executed, the ARO", true) . "\n" . - "\t\t" . __("specified (and its children, if any) will have DENY access to the", true) . "\n" . - "\t\t" . __("specified ACO action (and the ACO's children, if any).", true) . "\n" . - "\t\t" . __("For more detailed parameter usage info, see help for the 'create' command.", true) . "\n", + 'deny' => "deny []" . __("or", true) . " all\n" . + "\t" . __("Use this command to deny ACL permissions. Once executed, the ARO", true) . "\n" . + "\t" . __("specified (and its children, if any) will have DENY access to the", true) . "\n" . + "\t" . __("specified ACO action (and the ACO's children, if any).", true) . "\n" . + "\t" . __("For more detailed parameter usage info,", true) . "\n" . + "\t" . __("see help for the 'create' command.", true), - 'inherit' => "\tinherit []" . __("or", true) . " all\n" . - "\t\t" . __("Use this command to force a child ARO object to inherit its", true) . "\n" . - "\t\t" . __("permissions settings from its parent.", true) . "\n" . - "\t\t" . __("For more detailed parameter usage info, see help for the 'create' command.", true) . "\n", + 'inherit' => "inherit []" . __("or", true) . " all\n" . + "\t" . __("Use this command to force a child ARO object to inherit its", true) . "\n" . + "\t" . __("permissions settings from its parent.", true) . "\n" . + "\t" . __("For more detailed parameter usage info,", true) . "\n" . + "\t" . __("see help for the 'create' command.", true), - 'view' => "\tview aro|aco []\n" . - "\t\t" . __("The view command will return the ARO or ACO tree. The optional", true) . "\n" . - "\t\t" . __("id/alias parameter allows you to return only a portion of the requested tree.", true) . "\n" . - "\t\t" . __("For more detailed parameter usage info, see help for the 'create' command.", true) . "\n", + 'view' => "view aro|aco []\n" . + "\t" . __("The view command will return the ARO or ACO tree.", true) . "\n" . + "\t" . __("The optional id/alias parameter allows you to return\n\tonly a portion of the requested tree.", true) . "\n" . + "\t" . __("For more detailed parameter usage info,", true) . "\n" . + "\t" . __("see help for the 'create' command.", true), - 'initdb' => "\tinitdb\n". - "\t\t" . __("Uses this command : cake schema run create DbAcl", true) . "\n", + 'initdb' => "initdb\n". + "\t" . __("Uses this command : cake schema run create DbAcl", true), - 'help' => "\thelp []\n" . - "\t\t" . __("Displays this help message, or a message on a specific command.", true) . "\n" + 'help' => "help []\n" . + "\t" . __("Displays this help message, or a message on a specific command.", true) ); $this->out($head); @@ -427,8 +444,8 @@ class AclShell extends Shell { foreach ($commands as $cmd) { $this->out("{$cmd}\n\n"); } - } elseif (isset($commands[low($this->args[0])])) { - $this->out($commands[low($this->args[0])] . "\n\n"); + } elseif (isset($commands[strtolower($this->args[0])])) { + $this->out($commands[strtolower($this->args[0])] . "\n\n"); } else { $this->out(sprintf(__("Command '%s' not found", true), $this->args[0])); }