mirror of
https://github.com/myvesta/vesta
synced 2025-08-20 13:24:25 -07:00
Update main.php
This commit is contained in:
parent
b1c95879c6
commit
eaafe8dea3
1 changed files with 9 additions and 3 deletions
|
@ -7,7 +7,7 @@ define('myvesta_exit_on_error', true);
|
||||||
|
|
||||||
function myvesta_throw_error($code, $message) {
|
function myvesta_throw_error($code, $message) {
|
||||||
echo "ERROR: ".$message."\n";
|
echo "ERROR: ".$message."\n";
|
||||||
if (defined('myvesta_exit_on_error')) exit($code);
|
if (defined('myvesta_exit_on_error')) myvesta_exit($code);
|
||||||
return $code;
|
return $code;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -22,9 +22,9 @@ function myvesta_check_args ($requried_arguments, $arguments) {
|
||||||
global $argv;
|
global $argv;
|
||||||
$argument_counter=count($argv);
|
$argument_counter=count($argv);
|
||||||
$argument_counter--;
|
$argument_counter--;
|
||||||
|
$argv[0]=str_replace('/usr/local/vesta/bin/', '', $argv[0]);
|
||||||
|
echo "-------------------- ".$argv[0]." --------------------\n";
|
||||||
if ($argument_counter<$requried_arguments) {
|
if ($argument_counter<$requried_arguments) {
|
||||||
$command=$argv[0];
|
|
||||||
$command=str_replace('/usr/local/vesta/bin/', '', $command);
|
|
||||||
$arguments=str_replace(" ", "' '", $arguments);
|
$arguments=str_replace(" ", "' '", $arguments);
|
||||||
$arguments="'".$arguments."'";
|
$arguments="'".$arguments."'";
|
||||||
return myvesta_throw_error(1, "Usage: $command $arguments");
|
return myvesta_throw_error(1, "Usage: $command $arguments");
|
||||||
|
@ -36,3 +36,9 @@ function myvesta_check_args ($requried_arguments, $arguments) {
|
||||||
$i++;
|
$i++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function myvesta_exit($code) {
|
||||||
|
global $argv;
|
||||||
|
echo "==================== ".$argv[0].": ".$code." ====================\n";
|
||||||
|
exit($code);
|
||||||
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue