diff options
author | Michael Larabel <michael@phx-laptop.(none)> | 2008-12-05 12:24:07 -0500 |
---|---|---|
committer | Michael Larabel <michael@phx-laptop.(none)> | 2008-12-05 12:24:07 -0500 |
commit | 2cfc561b54c8a9ac40c335be7fb8f075eb26e35a (patch) | |
tree | a254a3f51992103496396144fedaf15f298ab364 /pts-core | |
parent | fad46140fae8ba0cfba18f29dce813a8490e3817 (diff) | |
download | phoronix-test-suite-upstream-2cfc561b54c8a9ac40c335be7fb8f075eb26e35a.tar.gz phoronix-test-suite-upstream-2cfc561b54c8a9ac40c335be7fb8f075eb26e35a.tar.xz phoronix-test-suite-upstream-2cfc561b54c8a9ac40c335be7fb8f075eb26e35a.zip |
pts-core: Eliminate need to statically code options and arguments in
phoronix-test-suite, but handle most of it dynamically
Diffstat (limited to 'pts-core')
-rw-r--r-- | pts-core/phoronix-test-suite.php | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/pts-core/phoronix-test-suite.php b/pts-core/phoronix-test-suite.php index 7cb84c1..2a25c87 100644 --- a/pts-core/phoronix-test-suite.php +++ b/pts-core/phoronix-test-suite.php @@ -25,6 +25,12 @@ require("pts-core/functions/pts-functions.php"); pts_init(); // Initalize the Phoronix Test Suite (pts-core) client +$sent_command = strtolower(str_replace("-", "_", $argv[1])); +if(!is_file("pts-core/options/" . $sent_command . ".php")) +{ + exit(3); +} + // Register PTS Process if(pts_process_active("phoronix-test-suite")) { @@ -37,14 +43,15 @@ pts_module_startup_init(); // Initialize the PTS module system // Read passed arguments $pass_args = array(); -for($i = 2; $i < $argc; $i++) +for($i = 3; $i < $argc; $i++) { if(isset($argv[$i])) { array_push($pass_args, $argv[$i]); } } -pts_run_option_next($argv[1], $pass_args, getenv("PTS_COMMAND")); + +pts_run_option_next($sent_command, $pass_args, $argv[2]); while(($current_option = pts_run_option_next(false)) != false) { |