diff options
Diffstat (limited to 'vendor/fwdansi/examples/run-rustc.rs')
-rw-r--r-- | vendor/fwdansi/examples/run-rustc.rs | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/vendor/fwdansi/examples/run-rustc.rs b/vendor/fwdansi/examples/run-rustc.rs new file mode 100644 index 0000000..7951601 --- /dev/null +++ b/vendor/fwdansi/examples/run-rustc.rs @@ -0,0 +1,17 @@ +extern crate fwdansi; +extern crate termcolor; + +use fwdansi::write_ansi; +use std::io; +use std::process::Command; +use termcolor::*; + +fn main() -> io::Result<()> { + let output = Command::new("rustc").args(&["--color", "always"]).output()?; + + let mut stderr = StandardStream::stderr(ColorChoice::Always); + write_ansi(&mut stderr, &output.stderr)?; + //^ should print "error: no input filename given" with appropriate color everywhere. + + Ok(()) +} |