Refactoring help parameter handling

git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@3764 3807eeeb-6ff5-0310-8944-8be069107fe0
This commit is contained in:
dho 2006-10-30 17:58:50 +00:00
parent 40381bf3ff
commit 846af89259

View file

@ -31,7 +31,7 @@
$cakeDir = CORE_PATH.DS.'cake'.DS;
$argCount = count($argv);
if ($argCount == 1 || $argv[1] == 'help') {
if ($argCount == 1 || isHelpParam($argv[1])) {
showHelp();
} else {
$taskName = $argv[1];
@ -40,7 +40,7 @@
$showHelp = false;
if ($argCount > 2) {
if ($argv[2] == 'help') {
if (isHelpParam($argv[2])) {
$showHelp = true;
} else {
$appPath = getAppPath($argv[2]);
@ -141,6 +141,10 @@
require($cakePath.'config'.DS.'paths.php');
}
function isHelpParam($param) {
return ($param == 'help' || $param == '--help');
}
function prepareParams($originalParams, $elementsToRemove) {
$params = $originalParams;