From 68389ac5b4e922aa24365229179296651ec4be0e Mon Sep 17 00:00:00 2001 From: Chris Nickel Date: Sat, 14 Dec 2019 13:26:20 -0500 Subject: [PATCH] Getting started example for 0.14 (#346) --- README.md | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 3e665a9..a868946 100644 --- a/README.md +++ b/README.md @@ -117,7 +117,11 @@ crossterm = "0.14" ```rust use std::io::{stdout, Write}; -use crossterm::{execute, ExecutableCommand, style::{Attribute, Color, SetForegroundColor, SetBackgroundColor, ResetColor, Print}, Result}; +use crossterm::{ + execute, + style::{Color, Print, ResetColor, SetBackgroundColor, SetForegroundColor}, + ExecutableCommand, Result, +}; fn main() -> Result<()> { // using the macro @@ -125,7 +129,7 @@ fn main() -> Result<()> { stdout(), SetForegroundColor(Color::Blue), SetBackgroundColor(Color::Red), - Output("Styled text here."), + Print("Styled text here."), ResetColor )?; @@ -133,14 +137,14 @@ fn main() -> Result<()> { stdout() .execute(SetForegroundColor(Color::Blue))? .execute(SetBackgroundColor(Color::Red))? - .execute(Output("Styled text here."))? + .execute(Print("Styled text here."))? .execute(ResetColor)?; Ok(()) } ``` -Checkout this [list](https://docs.rs/crossterm/0.13.0/crossterm/index.html#supported-commands) with all possible commands. +Checkout this [list](https://docs.rs/crossterm/0.14.0/crossterm/index.html#supported-commands) with all possible commands. ### Feature Flags