Expand description
§FYI Msg
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. |
Re-exports§
pub use fyi_ansi;pub use signal_hook;signal-hook
Macros§
- confirm
- Confirm.
Structs§
- Before
After progress - Before and After.
- Msg
- Message.
- Progless
progress - Progless.
- Progless
Task Guard progress - Progless Task Guard.
Enums§
- Ansi
Color - ANSI Colors (8/16/256).
- MsgKind
- Message Kind.
- Progless
Error progress - Obligatory error type.
Functions§
- fit_
to_ width fitted - Fit to Width.
- length_
width fitted - Length Width.
- width
fitted - Width.