diff options
-rwxr-xr-x | util/fresh | 57 |
1 files changed, 57 insertions, 0 deletions
diff --git a/util/fresh b/util/fresh new file mode 100755 index 000000000..450d17464 --- /dev/null +++ b/util/fresh @@ -0,0 +1,57 @@ +#!/usr/bin/env php +<?php + +// Red cli interpreter + +require_once('include/cli_startup.php'); + +cli_startup(); + +$prompt = 'fresh% '; + +function fresh_main($argc,$argv) { + global $prompt; + + while(!feof(STDIN)) { + + + if(function_exists('readline')) + $line = readline($prompt); + else { + echo "\n" . $prompt; + $line = fgets(STDIN); + } + + + if($line === FALSE) { + if(feof(STDIN)) { + break; + } + continue; + } + + $line = trim($line); + if($line == 'quit' || $line == 'exit') + exit(); + process_command($line); + } + +} + +fresh_main($argc,$argv); + +function process_command($line) { + + // split args + + if($line == 'version') { + echo 'Fresh version 0.1'; + return; + } + + + + +} + + |