File tree Expand file tree Collapse file tree 1 file changed +13
-1
lines changed Expand file tree Collapse file tree 1 file changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -264,7 +264,7 @@ fn main() {
264
264
265
265
fn spawn_watch_shell ( failed_exercise_hint : & Arc < Mutex < Option < String > > > ) {
266
266
let failed_exercise_hint = Arc :: clone ( failed_exercise_hint) ;
267
- println ! ( "Type 'hint' or open the corresponding README.md file to get help or type 'clear' to clear the screen ." ) ;
267
+ println ! ( "Welcome to watch mode! You can type 'help' to get an overview of the commands you can use here ." ) ;
268
268
thread:: spawn ( move || loop {
269
269
let mut input = String :: new ( ) ;
270
270
match io:: stdin ( ) . read_line ( & mut input) {
@@ -276,6 +276,18 @@ fn spawn_watch_shell(failed_exercise_hint: &Arc<Mutex<Option<String>>>) {
276
276
}
277
277
} else if input. eq ( "clear" ) {
278
278
println ! ( "\x1B [2J\x1B [1;1H" ) ;
279
+ } else if input. eq ( "quit" ) {
280
+ println ! ( "Bye!" ) ;
281
+ std:: process:: exit ( 0 ) ;
282
+ } else if input. eq ( "help" ) {
283
+ println ! ( "Commands available to you in watch mode:" ) ;
284
+ println ! ( " hint - prints the current exercise's hint" ) ;
285
+ println ! ( " clear - clears the screen" ) ;
286
+ println ! ( " quit - quits watch mode" ) ;
287
+ println ! ( " help - displays this help message" ) ;
288
+ println ! ( ) ;
289
+ println ! ( "Watch mode automatically re-evaluates the current exercise" ) ;
290
+ println ! ( "when you edit a file's contents." )
279
291
} else {
280
292
println ! ( "unknown command: {}" , input) ;
281
293
}
You can’t perform that action at this time.
0 commit comments