Browse Source

Commands, updated function head

Lorenz Bung 8 years ago
parent
commit
9b893e0104
1 changed files with 14 additions and 0 deletions
  1. 14
    0
      hw6/task2/src/shell.rs

+ 14
- 0
hw6/task2/src/shell.rs View File

6
 }
6
 }
7
 
7
 
8
 impl Shell<R, W> {
8
 impl Shell<R, W> {
9
+    /// Creates a new Shell.
9
     pub fn new(input: R, output: W, name: String) -> Self {
10
     pub fn new(input: R, output: W, name: String) -> Self {
10
         Shell {
11
         Shell {
11
             reader = input,
12
             reader = input,
12
             writer = output,
13
             writer = output,
14
+            should_exit = false,
13
             name = name,
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
 impl BufRead for Shell<R, W> {
32
 impl BufRead for Shell<R, W> {

Loading…
Cancel
Save