#cli #bash #console #printing #stderr #printer #struct #message #msg #heart

fyi_msg

Simple ANSI-formatted, prefixed messages for console printing

20 releases

Uses new Rust 2021

0.10.2 Sep 22, 2022
0.10.0 Aug 23, 2022
0.9.14 Jul 15, 2022
0.9.7 Mar 30, 2022
0.8.1 Jun 17, 2021
Download history 5/week @ 2022-06-10 40/week @ 2022-06-17 31/week @ 2022-06-24 29/week @ 2022-07-01 20/week @ 2022-07-08 60/week @ 2022-07-15 49/week @ 2022-07-22 19/week @ 2022-07-29 28/week @ 2022-08-05 20/week @ 2022-08-12 30/week @ 2022-08-19 17/week @ 2022-08-26 8/week @ 2022-09-02 77/week @ 2022-09-09 36/week @ 2022-09-16 30/week @ 2022-09-23

151 downloads per month

WTFPL license

110KB
2K 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.

License

Copyright © 2022 Blobfolio, LLC <hello@blobfolio.com>

This work is free. You can redistribute it and/or modify it under the terms of the Do What The Fuck You Want To Public License, Version 2.

DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004

Copyright (C) 2004 Sam Hocevar <sam@hocevar.net>

Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.

DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION

0. You just DO WHAT THE FUCK YOU WANT TO.

Dependencies

~250–455KB