aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorfriendica <info@friendica.com>2013-01-12 14:42:05 -0800
committerfriendica <info@friendica.com>2013-01-12 14:42:05 -0800
commitf1f04f6a3ba5d8aab6198586528c6d0ce91dffaf (patch)
tree34b2745a4c03c6f633a36675f1abc41fe9d5d67e
parent82e0c04d92deab0dfc9e26841ef6a0abbf387952 (diff)
downloadvolse-hubzilla-f1f04f6a3ba5d8aab6198586528c6d0ce91dffaf.tar.gz
volse-hubzilla-f1f04f6a3ba5d8aab6198586528c6d0ce91dffaf.tar.bz2
volse-hubzilla-f1f04f6a3ba5d8aab6198586528c6d0ce91dffaf.zip
skeleton for red shell
-rwxr-xr-xutil/fresh57
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;
+ }
+
+
+
+
+}
+
+