diff options
| author | Kevin Ballard <kevin@sb.org> | 2013-06-28 20:29:04 -0700 |
|---|---|---|
| committer | Daniel Micay <danielmicay@gmail.com> | 2013-06-29 01:02:07 -0400 |
| commit | ee7307e6cb9e942fc1ef27109bfbc6fbf730ee3c (patch) | |
| tree | 59b76cea88591fb675664c17d72cd6eed2b40c17 /src | |
| parent | a0c31ece9dba3665e0a44650ea492ae6f3e5604a (diff) | |
| download | rust-ee7307e6cb9e942fc1ef27109bfbc6fbf730ee3c.tar.gz rust-ee7307e6cb9e942fc1ef27109bfbc6fbf730ee3c.zip | |
Smarter warning in extra::term::Terminal.reset()
Don't spew a warn!() in reset() if num_colors is 0, because non-color-supporting terminals are legit. Use debug!() there instead. Continue spewing warn!() if we believe the terminal to support colors. Use a better warning when the `op` capability can't be found.
Diffstat (limited to 'src')
| -rw-r--r-- | src/libextra/term.rs | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/libextra/term.rs b/src/libextra/term.rs index 880b89f2bbe..d448a1588a6 100644 --- a/src/libextra/term.rs +++ b/src/libextra/term.rs @@ -120,13 +120,15 @@ impl Terminal { pub fn reset(&self) { let mut vars = Variables::new(); let s = do self.ti.strings.find_equiv(&("op")) - .map_consume_default(Err(~"can't find op")) |&op| { + .map_consume_default(Err(~"can't find terminfo capability `op`")) |&op| { expand(op, [], &mut vars) }; if s.is_ok() { self.out.write(s.unwrap()); - } else { + } else if self.num_colors > 0 { warn!("%s", s.unwrap_err()); + } else { + debug!("%s", s.unwrap_err()); } } |
