Crate zolt

Source
Expand description

This is an opinionated CLI library for beautiful and user-friendly terminal output. It aims to give the Rust ecosystem similar tooling as Rich for Python.

Note that the library is still very much a work in progress.

§Available utilies

§Enabling/disabling color

Most of the functions in this library include color in some fashion when printing to the terminal.

Color will be automatically disabled in any of these circumstances:

  • The NO_COLOR environment variable is set
  • The CLICOLOR environment variable is set to 0
  • std::io::Stdout isn’t a TTY (i.e. when being piped or in a noninteractive terminal)

The above situations are ignored in any of these circumstances:

  • The CLICOLOR environment variable is set to anything other than 0
  • The CLICOLOR_FORCE environment variable is set

CLI coloring can also be manually set on and off through the show_color function.

Re-exports§

pub use colored::Colorize;
pub use msg::debug;
pub use msg::debugfmt;
pub use msg::debugln;
pub use msg::err;
pub use msg::errfmt;
pub use msg::errln;
pub use msg::info;
pub use msg::infofmt;
pub use msg::infoln;
pub use msg::warn;
pub use msg::warnfmt;
pub use msg::warnln;
pub use colored;

Modules§

msg
Utilities for general CLI messaging.

Functions§

show_color
Whether coloring should be on or off.