about summary refs log tree commit diff
path: root/users/tazjin/rlox/src
diff options
context:
space:
mode:
Diffstat (limited to 'users/tazjin/rlox/src')
-rw-r--r--users/tazjin/rlox/src/main.rs23
1 files changed, 23 insertions, 0 deletions
diff --git a/users/tazjin/rlox/src/main.rs b/users/tazjin/rlox/src/main.rs
new file mode 100644
index 000000000000..3f173673a177
--- /dev/null
+++ b/users/tazjin/rlox/src/main.rs
@@ -0,0 +1,23 @@
+use std::process;
+use std::env;
+
+fn run_file(_file: &str) {
+    unimplemented!("no file support yet")
+}
+
+fn run_prompt() {
+    unimplemented!("no prompt support yet")
+}
+
+fn main() {
+    let mut args = env::args();
+
+    if args.len() > 1 {
+        println!("Usage: rlox [script]");
+        process::exit(1);
+    } else if let Some(file) = args.next() {
+        run_file(&file);
+    } else {
+        run_prompt();
+    }
+}