mirror of
https://github.com/sharkdp/hexyl.git
synced 2026-10-26 20:16:31 +00:00
Return a proper error if terminal size fails
This commit is contained in:
1 parent
ab381e88f8
commit
cc9476d665
1 file changed
+1
-1
+1
-1
@@ -329,7 +329,7 @@ fn run() -> Result<(), AnyhowError> {
|
|||||||
{
|
{
|
||||||
Some(terminal_width)
|
Some(terminal_width)
|
||||||
} else if matches.is_present("auto_width") {
|
} else if matches.is_present("auto_width") {
|
||||||
Some(terminal_size().expect("not a tty").0 .0)
|
Some(terminal_size().ok_or_else(|| anyhow!("not a TTY"))?.0 .0)
|
||||||
} else {
|
} else {
|
||||||
None
|
None
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in new issue
Block a user