aboutsummaryrefslogtreecommitdiff
path: root/src/parseopts.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/parseopts.rs')
-rw-r--r--src/parseopts.rs14
1 files changed, 13 insertions, 1 deletions
diff --git a/src/parseopts.rs b/src/parseopts.rs
index 60f811e..fb04c0d 100644
--- a/src/parseopts.rs
+++ b/src/parseopts.rs
@@ -40,20 +40,32 @@ impl OptsBuilder {
pub fn build(self) -> Opts {
Opts {
width: self.width.unwrap_or_else(|| {
+ #[cfg(feature = "libc")]
if let Ok((width, _)) = crate::term::get_terminal_size() {
width as usize
} else {
- println!("Could not determine TTY columns, specify with -r");
+ println!("Could not determine TTY columns, specify with -w");
+ std::process::exit(1);
+ }
+ #[cfg(not(feature = "libc"))]
+ {
+ println!("Not compiled with libc, cannot detect columns, specify with -w");
std::process::exit(1);
}
}),
height: self.height.unwrap_or_else(|| {
+ #[cfg(feature = "libc")]
if let Ok((_, height)) = crate::term::get_terminal_size() {
height as usize - 1
} else {
println!("Could not determine TTY rows, specify with -h");
std::process::exit(1);
}
+ #[cfg(not(feature = "libc"))]
+ {
+ println!("Not compiled with libc, cannot detect rows, specify with -h");
+ std::process::exit(1);
+ }
}),
graph_type: self.graph_type,
silent: self.silent,