mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-01-31 09:06:17 +00:00
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:
parent
40381bf3ff
commit
846af89259
1 changed files with 6 additions and 2 deletions
|
@ -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;
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue