File tree 6 files changed +21
-41
lines changed
6 files changed +21
-41
lines changed Original file line number Diff line number Diff line change @@ -11,6 +11,4 @@ Cargo.lock
11
11
** /* .rs.bk
12
12
13
13
# MSVC Windows builds of rustc generate these, which store debugging information
14
- * .pdb
15
-
16
- hidden /
14
+ * .pdb
Original file line number Diff line number Diff line change @@ -12,4 +12,5 @@ regex = "0.1"
12
12
reqwest = { version = " 0.11.0" , features = [" blocking" ] }
13
13
rodio = " 0.17.3"
14
14
sys-info = " 0.7.0"
15
- clap = " 3.0"
15
+ clap = " 3.0"
16
+ clearscreen = " 2.0.1"
Load Diff This file was deleted.
Load Diff This file was deleted.
Load Diff This file was deleted.
Original file line number Diff line number Diff line change @@ -1287,15 +1287,32 @@ impl Executor {
1287
1287
return ;
1288
1288
}
1289
1289
}
1290
- self . log_print ( String :: from ( "Error! item not found in this list" ) . as_str ( ) . to_owned ( ) + "\n " ) ;
1290
+ self . log_print ( "Error! item not found in this list" . to_owned ( ) + "\n " ) ;
1291
1291
self . stack . push ( Type :: Error ( String :: from ( "item-not-found" ) ) ) ;
1292
1292
}
1293
1293
1294
+ "cls" => {
1295
+ self . clearscreen ( ) ;
1296
+ }
1297
+
1298
+ "clear" => {
1299
+ self . clearscreen ( ) ;
1300
+ }
1301
+
1294
1302
// If it is not recognized as a command, use it as a string.
1295
1303
_ => self . stack . push ( Type :: String ( command) ) ,
1296
1304
}
1297
1305
}
1298
1306
1307
+ fn clearscreen ( & mut self ) {
1308
+ let result = clearscreen:: clear ( ) ;
1309
+ if result. is_err ( ) {
1310
+ println ! ( "Error! Failed to clear screen" ) ;
1311
+ self . stack
1312
+ . push ( Type :: Error ( String :: from ( "failed-to-clear-screen" ) ) ) ;
1313
+ }
1314
+ }
1315
+
1299
1316
/// Pop stack's top value
1300
1317
fn pop_stack ( & mut self ) -> Type {
1301
1318
if let Some ( value) = self . stack . pop ( ) {
You can’t perform that action at this time.
0 commit comments