Document clear_screen functions

This commit is contained in:
Félix Saparelli 2021-04-11 01:02:44 +12:00
parent c42fe66985
commit 7d523dfcf0
No known key found for this signature in database
GPG Key ID: B948C4BAE44FC474
1 changed files with 5 additions and 0 deletions

View File

@ -99,17 +99,22 @@ impl ArgsBuilder {
pub fn debug(&mut self, _: impl Into<bool>) -> &mut Self {
self
}
}
/// Clear the screen.
#[cfg(target_family = "windows")]
pub fn clear_screen() {
// TODO: clearscreen with powershell?
let _ = Command::new("cmd")
.arg("/c")
.arg("tput reset || cls")
.status();
}
/// Clear the screen.
#[cfg(target_family = "unix")]
pub fn clear_screen() {
// TODO: clear screen via control codes instead
let _ = Command::new("tput").arg("reset").status();
}