Skip to content

Commit

Permalink
First commit.
Browse files Browse the repository at this point in the history
  • Loading branch information
ColinChartier committed Nov 12, 2018
0 parents commit a43d966
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
out/
30 changes: 30 additions & 0 deletions src/com/colinchartier/mvcexample/Main.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
package com.colinchartier.mvcexample;

import java.io.BufferedReader;
import java.io.File;
import java.io.IOException;
import java.io.InputStreamReader;

public class Main {
public static void main(String[] args) throws IOException {
String path = "/";

BufferedReader r = new BufferedReader(new InputStreamReader(System.in));
while(true) {
System.out.print("> ");
String line = r.readLine();
if("ls".equals(line)) {
for(File f : new File(path).listFiles()) {
System.out.println("File: " + f);
}
} else if(line.startsWith("cd")) {
path = line.split(" ", 2)[1];
System.out.println("Path is now " + path);
} else if("pwd".equals(line)) {
System.out.println("Current path: " + path);
} else if("exit".equals(line)) {
System.exit(0);
}
}
}
}

0 comments on commit a43d966

Please sign in to comment.