leg

Crates.ioleg
lib.rsleg
version1.0.2
sourcesrc
created_at2019-05-25 18:56:22.157238
updated_at2022-09-04 20:52:01.776806
descriptionπŸ”ˆ Elegant print for lazy devs (async-std)
homepage
repositoryhttps://github.com/jesusprubio/leg.git
max_upload_size
id136994
size8,952
JesΓΊs Rubio (jesusprubio)

documentation

https://docs.rs/leg

README

leg

πŸ”ˆ Elegant print for lazy devs

Demo

Workflow status Latest version

Make your CLIs nicer with minimal effort. Simple wrapper on top of:

Do not use this crate in libraries! You should use the log one instead. Visit this section of the book Command line apps in Rust if you want to learn more about this topic.

Install

With cargo-edit installed run:

cargo add leg

Use

πŸ“ Please visit tests and full documentation if you want to learn the details.

use leg::*;
use async_std::{eprint, eprintln};

#[async_std::main]
async fn main() {
    head("leg", Some("πŸ”ˆ"), Some("1.0.0")).await;
    info("Informational message", None, None).await;
    success("Successful operation", None, None).await;
    warn("Warn message", None, None).await;
    error("Error message", None, None).await;
    wait("Waiting for something", None, None).await;
    done("Something finished", None, None).await;

    info("Informational message with scope", Some("myscope"), None).await;
    info("Informational message without new line", None, Some(false)).await;
    eprintln!(" => same line").await;

    eprint!("Not shown").await;
    remove().await;

    result("To standard output").await;
}
Commit count: 2

cargo fmt