added tests and method to convert styledobject into displayableobject

This commit is contained in:
TimonPost 2018-09-21 21:36:03 +02:00
parent a92274c028
commit 3d7748ba3d
4 changed files with 6 additions and 1 deletions

View File

@ -22,9 +22,14 @@ use crossterm::style::{style, Color, DisplayableObject};
use crossterm::terminal::terminal;
use crossterm::Screen;
use crossterm::output::TerminalOutput;
fn main()
{
let screen = Screen::default();
let output = TerminalOutput::new(false);
println!("\nExample:\n\n\taws --profile {} s3 ls\n", DisplayableObject::new(&screen, &style("test").with(Color::Yellow)));
let bytes = "test".as_bytes();
let result = output.write_str("test");
println!("bytes: {} written: {}", bytes.len(), result.unwrap());
}

View File

View File

View File