|
|
@@ -6,13 +6,27 @@ struct Shell<R, W> {
|
|
6
|
6
|
}
|
|
7
|
7
|
|
|
8
|
8
|
impl Shell<R, W> {
|
|
|
9
|
+ /// Creates a new Shell.
|
|
9
|
10
|
pub fn new(input: R, output: W, name: String) -> Self {
|
|
10
|
11
|
Shell {
|
|
11
|
12
|
reader = input,
|
|
12
|
13
|
writer = output,
|
|
|
14
|
+ should_exit = false,
|
|
13
|
15
|
name = name,
|
|
14
|
16
|
}
|
|
15
|
17
|
}
|
|
|
18
|
+ /// Initializes the Shell Loop
|
|
|
19
|
+ pub fn start() -> Result<Self, &str> {
|
|
|
20
|
+ }
|
|
|
21
|
+ /// Waits for user inputs.
|
|
|
22
|
+ fn shell_loop() -> Result {
|
|
|
23
|
+ }
|
|
|
24
|
+ /// Prints the shell prompt.
|
|
|
25
|
+ fn prompt() -> Result<Option, &str> {
|
|
|
26
|
+ }
|
|
|
27
|
+ /// Runs a command.
|
|
|
28
|
+ fn run(&str) {
|
|
|
29
|
+ }
|
|
16
|
30
|
}
|
|
17
|
31
|
|
|
18
|
32
|
impl BufRead for Shell<R, W> {
|