Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.
Nabil Boutemeur 795d3ecf77
Merge pull request #2 from repi/patch-1
pirms 1 gada
examples Added example pirms 1 gada
src Remove unused code pirms 1 gada
.gitignore initial commit pirms 1 gada
.gitlab-ci.yml Added GitlabCI configuration pirms 1 gada
Cargo.toml Update license in Cargo.toml pirms 1 gada
LICENSE Change license to MIT pirms 1 gada
README.md Fix README incorrect license reference pirms 1 gada
appveyor.yml Fix for AppVeyor config pirms 1 gada

README.md

crates.io Released API docs Downloads MIT Licensed AppVeyor CI pipeline status

Output-VT100

This 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:

extern crate output_vt100;

fn main() {
    output_vt100::init();
    println!("\x1b[31mThis text is red!\x1b[0m");
}

If you wish to ensure the output_vt100::init() function is only ran once, you can use the crate ctor. Be aware though it might not be suited for every use case, as explained on the crate’s presentation.

extern crate output_vt100;
extern crate ctor;
use ctor::*;

#[ctor]
fn init_term() {
    output_vt100::init();
}

fn main() {
    println!("\x1b[31mThis text is red!\x1b[0m");
}

Not that init panics on error, if you do not wish to panic, use output_vt100::try_init which returns a Result<(), ()>

Acknowledgements

A big thank you to nbouteme who helped me a lot during the development of this create.