コード例 #1
0
ファイル: JShell.java プロジェクト: JBKahn/Java_Shell
 /** JShell constructor. Initialize instance variables and map each command to a number. */
 public JShell() {
   currentDirectory_ = new Directory("", "/", null);
   rootDirectory_ = currentDirectory_;
   rootDirectory_.setParentDirectory(rootDirectory_);
   commands_ = new HashMap<String, Integer>();
   commands_.put("exit", 0);
   commands_.put("mkdir", 1);
   commands_.put("cd", 2);
   commands_.put("ls", 3);
   commands_.put("pwd", 4);
   commands_.put("mv", 5);
   commands_.put("cp", 6);
   commands_.put("cat", 7);
   commands_.put("get", 8);
   commands_.put("echo", 9);
   commands_.put("rm", 10);
   commands_.put("ln", 11);
   commands_.put("man", 12);
   commands_.put("find", 13);
   commands_.put("grep", 14);
 }