summaryrefslogtreecommitdiffstats
path: root/openstack-console/src/main/java/com/woorea/openstack/console/Environment.java
blob: ca0eee467c91f5efa1bb7b424e122c44558f0358 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
package com.woorea.openstack.console;
import java.util.Map;
import java.util.TreeMap;


public class Environment {

	protected final Environment parent;
	
	protected Map<String, Command> commands = new TreeMap<String, Command>();
	
	public Environment(Environment parent) {
		register(Commands.EXIT);
		register(Commands.SET);
		this.parent = parent;
	}
	
	public Environment() {
		this(null);
	}

	public void register(Command command) {
		commands.put(command.name, command);
	}

	public String getPrompt() {
		return "> ";
	}

}