59 releases (14 stable)

Uses new Rust 2024

new 1.8.1 Mar 13, 2025
1.7.1 Feb 26, 2025
1.4.0 Dec 10, 2024
1.3.0 Nov 28, 2024
0.8.1 Jun 17, 2021

#113 in Command-line interface

Download history 12/week @ 2024-11-20 175/week @ 2024-11-27 82/week @ 2024-12-04 79/week @ 2024-12-11 3/week @ 2024-12-18 153/week @ 2025-01-01 229/week @ 2025-01-08 168/week @ 2025-01-15 1352/week @ 2025-01-29 88/week @ 2025-02-05 9/week @ 2025-02-12 152/week @ 2025-02-19 205/week @ 2025-02-26 11/week @ 2025-03-05

377 downloads per month

WTFPL license

160KB
3K 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–9MB
~101K SLoC