Crate arch_msgs

Source
Expand description

§arch_msgs

arch_msgs provides macros to print messages in the style that is used by Arch Linux scripts. Command line tools written in Rust can print command line messages for errors, warnings, etc. with this crate in the same style as Arch Linux scripts do.

In an Arch Linux installation, corresponding functions are contained in the script /usr/share/makepkg/util/message.sh and used by other scripts such as makepkg or mkarchroot.

§Mapping of Arch Linux functions to the macros of this crate

Message typeArch Linux functionCorresponding macro of this crate
Errorerror ...error!(...)
Informationmsg2 ...info!(...)
Messageplain ...msg!(...)
Questionask ...question!(...)
Successmsg ...success!(...)
Warningwarning ...warning!(...)

All macros of this crate have the same signature as println and print a new line at the end

Macros§

error
Print an error message in Arch Linux style
info
Print an information message in Arch Linux style
msg
Print a message in Arch Linux style
plain
Print a plain message in Arch Linux style
question
Print a question in Arch Linux style
warning
Print a warning in Arch Linux style

Traits§

Colorize
The trait that enables something to be given color.