#messages #msg #console #printing #stderr #stdout #status

fyi_msg

Simple ANSI-formatted, prefixed messages for console printing

51 releases (6 stable)

new 1.4.0 Dec 10, 2024
1.3.0 Nov 28, 2024
1.1.1 Oct 17, 2024
0.14.1 Sep 27, 2024
0.8.1 Jun 17, 2021

#113 in Command-line interface

Download history 161/week @ 2024-09-05 16/week @ 2024-09-12 43/week @ 2024-09-19 148/week @ 2024-09-26 14/week @ 2024-10-03 185/week @ 2024-10-10 194/week @ 2024-10-17 9/week @ 2024-10-24 19/week @ 2024-10-31 119/week @ 2024-11-07 129/week @ 2024-11-14 8/week @ 2024-11-21 178/week @ 2024-11-28 103/week @ 2024-12-05

420 downloads per month

WTFPL license

135KB
2.5K SLoC

FYI Msg

docs.rs
crates.io ci deps.rs
license

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.

Examples

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.

Macros

Macro Equivalent
confirm!() Msg::new(MsgKind::Confirm, "Some question…").prompt()

Optional Features

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.

Dependencies

~0.2–8.5MB
~86K SLoC