Crates.io | fyi_msg |
lib.rs | fyi_msg |
version | |
source | src |
created_at | 2021-06-15 02:29:34.831397 |
updated_at | 2024-12-10 18:26:08.12516 |
description | Simple ANSI-formatted, prefixed messages for console printing. |
homepage | |
repository | https://github.com/Blobfolio/fyi |
max_upload_size | |
id | 410210 |
Cargo.toml error: | TOML parse error at line 20, column 1 | 20 | autolib = false | ^^^^^^^ unknown field `autolib`, expected one of `name`, `version`, `edition`, `authors`, `description`, `readme`, `license`, `repository`, `homepage`, `documentation`, `build`, `resolver`, `links`, `default-run`, `default_dash_run`, `rust-version`, `rust_dash_version`, `rust_version`, `license-file`, `license_dash_file`, `license_file`, `licenseFile`, `license_capital_file`, `forced-target`, `forced_dash_target`, `autobins`, `autotests`, `autoexamples`, `autobenches`, `publish`, `metadata`, `keywords`, `categories`, `exclude`, `include` |
size | 0 |
This crate contains the objects providing the heart of the FYI command line application, namely Msg
, a simple struct for status-like messages that can be easily printed to STDOUT
or STDERR
.
use fyi_msg::{Msg, MsgKind};
// One way.
Msg::new(MsgKind::Success, "You did it!")
.with_newline(true)
.print();
// Another equivalent way.
Msg::success("You did it!").print();
For more usage examples, check out the examples/msg
demo, which covers just about every common use case.
Macro | Equivalent |
---|---|
confirm!(…) |
Msg::new(MsgKind::Confirm, "Some question…").prompt() |
Feature | Description |
---|---|
fitted |
Enables Msg::fitted for obtaining a slice trimmed to a specific display width. |
progress |
Enables Progless , a thread-safe CLI progress bar displayer. |
timestamps |
Enables timestamp-related methods and flags like Msg::with_timestamp . |