Name | Date | Size | #Lines | LOC | ||
---|---|---|---|---|---|---|
.. | 03-May-2022 | - | ||||
examples/ | H | 03-May-2022 | - | 7 | 5 | |
src/ | H | 03-May-2022 | - | 75 | 44 | |
.cargo-checksum.json | H A D | 03-May-2022 | 89 | 1 | 1 | |
.cargo_vcs_info.json | H A D | 01-Jan-1970 | 74 | 6 | 5 | |
.gitignore | H A D | 21-Feb-2019 | 29 | 3 | 3 | |
.gitlab-ci.yml | H A D | 21-Feb-2019 | 205 | 15 | 12 | |
Cargo.toml | H A D | 01-Jan-1970 | 998 | 27 | 25 | |
Cargo.toml.orig-cargo | H A D | 21-Feb-2019 | 482 | 15 | 13 | |
LICENSE | H A D | 21-Feb-2019 | 1.1 KiB | 22 | 17 | |
README.md | H A D | 21-Feb-2019 | 1.7 KiB | 44 | 32 | |
appveyor.yml | H A D | 21-Feb-2019 | 1.9 KiB | 73 | 62 |
README.md
1[![crates.io](https://img.shields.io/crates/v/output_vt100.svg?style=flat)](https://crates.io/crates/output_vt100) 2[![Released API docs](https://docs.rs/output_vt100/badge.svg)](https://docs.rs/output_vt100) 3[![Downloads](https://img.shields.io/crates/d/output_vt100.svg?style=flat)](https://crates.io/crates/output_vt100) 4[![GPL-3.0 Licensed](https://img.shields.io/crates/l/output_vt100.svg?style=flat)](https://crates.io/crates/output_vt100) 5[![AppVeyor CI](https://img.shields.io/appveyor/ci/Phundrak/output-vt100-rs.svg?style=flat)](https://ci.appveyor.com/project/Phundrak/output-vt100-rs) 6[![pipeline status](http://labs.phundrak.fr/phundrak/output-vt100-rs/badges/master/pipeline.svg)](http://labs.phundrak.fr/phundrak/output-vt100-rs/commits/master) 7 8# Output-VT100 9 10This simple crates allows developers to enable ANSI escape characters in Windows' console, be it CMD or PowerShell. Its usage is very simple, as shown below: 11 12```rust 13extern crate output_vt100; 14 15fn main() { 16 output_vt100::init(); 17 println!("\x1b[31mThis text is red!\x1b[0m"); 18} 19``` 20 21If you wish to ensure the `output_vt100::init()` function is only ran once, you can use the crate [ctor](https://crates.io/crates/ctor). Be aware though it might not be suited for every use case, as explained on the crate’s presentation. 22 23```rust 24extern crate output_vt100; 25extern crate ctor; 26use ctor::*; 27 28#[ctor] 29fn init_term() { 30 output_vt100::init(); 31} 32 33fn main() { 34 println!("\x1b[31mThis text is red!\x1b[0m"); 35} 36``` 37 38Not that init panics on error, if you do not wish to panic, use 39`output_vt100::try_init` which returns a `Result<(), ()>` 40 41# Acknowledgements 42 43A big thank you to [nbouteme](https://github.com/nbouteme) who helped me a lot during the development of this create. 44