ソースを参照

Use one-line view when output is not to a terminal

Ben S 11 年 前
コミット
35a0ba3ba0
1 ファイル変更4 行追加2 行削除
  1. 4 2
      src/options.rs

+ 4 - 2
src/options.rs

@@ -74,8 +74,10 @@ impl Options {
             Lines
         }
         else {
-            let (console_width, _) = term::dimensions().unwrap_or((80, 24));
-            Grid(matches.opt_present("across"), console_width)
+            match term::dimensions() {
+                None => Lines,
+                Some((width, _)) => Grid(matches.opt_present("across"), width),
+            }
         }
     }