summaryrefslogtreecommitdiff
path: root/Source/Applications/Shell/Shell.class.h
blob: 94a6c2a792a9d02c46738653bc6cf571b518ae04 (plain) (blame)
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
31
32
33
34
35
36
37
38
39
40
41
42
43
#ifndef DEF_SHELL_CLASS_H
#define DEF_SHELL_CLASS_H

#include <Binding/VirtualTerminal.class.h>
#include <Binding/FSNode.class.h>
#include <String.class.h>
#include <Map.class.h>

#include <App/ShellApp.proto.h>

#define PROMPTS_COLOR 1
#define PROMPTV_COLOR 9
#define ENTRY_COLOR 6
#define NORMAL_COLOR 7

struct shell_var_t {
	bool readonly;
	String value;
};

class Shell : public ShellApp {
	Map<String, shell_var_t> m_vars;

	void setupVars();

	public:
	Shell();

	int run();

	FSNode cwd;

	bool appRun(const String& name, Vector<String>& args);

	void cd(Vector<String>& args);
	void pwd(Vector<String>& args);
	void rm(Vector<String>& args);
	void mkdir(Vector<String>& args);
	void wf(Vector<String>& args);
	void run(Vector<String>& args);
};

#endif