mirror of
https://github.com/oldminecraftcommunity/NostalgiaCore.git
synced 2026-11-20 19:49:44 +00:00
Allow console parameters
This commit is contained in:
parent
a6ddba8d97
commit
19aa4bd527
3 changed files with 54 additions and 15 deletions
|
|
@ -107,7 +107,7 @@ function parseNBTData($data){
|
|||
}
|
||||
|
||||
|
||||
function arg($name, $default){
|
||||
function arg($name, $default = false){
|
||||
global $arguments, $argv;
|
||||
if(!isset($arguments)){
|
||||
$arguments = arguments($argv);
|
||||
|
|
@ -127,7 +127,7 @@ function arguments ( $args ){
|
|||
array_shift( $args );
|
||||
$args = join( $args, ' ' );
|
||||
|
||||
preg_match_all('/ (--\w+ (?:[= ] [^-]+ [^\s-] )? ) | (-\w+) | (\w+) /x', $args, $match );
|
||||
preg_match_all('/ (--[\w\-]+ (?:[= ] [^-]+ [^\s-] )? ) | (-\w+) | (\w+) /x', $args, $match );
|
||||
$args = array_shift( $match );
|
||||
|
||||
$ret = array(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue