[−][src]Macro terminfo::expand
Expand a parametrized string.
Examples
Write the expansion to stdout
.
use terminfo::{Database, capability as cap}; use std::io; let info = Database::from_env().unwrap(); // Move the cursor to X: 20, Y: 30 expand!(io::stdout(), info.get::<cap::CursorAddress>().unwrap().as_ref(); 20, 30).unwrap();
Load the expansion for later usage.
use terminfo::{Database, capability as cap}; use std::io; let info = Database::from_env().unwrap(); // Set foreground color to red. let red = expand!(info.get::<cap::SetAForeground>().unwrap().as_ref(); 1).unwrap(); let on_blue = expand!(info.get::<cap::SetABackground>().unwrap().as_ref(); 4).unwrap();