<!--
SPDX-FileCopyrightText: 2022-2026 Michael Picht <mipi@fsfe.org>

SPDX-License-Identifier: GPL-3.0-or-later
-->

[![Crates.io (latest)](https://img.shields.io/crates/dv/arch_msgs?label=crates.io&style=flat)](https://crates.io/crates/arch_msgs)
[![Documentation](https://docs.rs/arch_msgs/badge.svg)](https://docs.rs/arch_msgs)
[![REUSE status](https://api.reuse.software/badge/codeberg.org/rust-utils/arch_msgs)](https://api.reuse.software/info/codeberg.org/rust-utils/arch_msgs)

# arch_msgs 

arch_msgs provides macros to print messages in the style that is used by [Arch Linux](https://archlinux.org) scripts. Command line tools written in [Rust](https://www.rust-lang.org/) 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 type | Arch Linux function | Corresponding macro of this crate |
| :--- | :--- | :--- |
| Error | `error ...` | `error!(...)` |
| Information | `msg2 ...` | `info!(...)` |
| Message | `msg ...` | `msg!(...)` |
| Plain message | `plain ...` | `plain!(...)` |
| Question | `ask ...` | `question!(...)` |
| Warning | `warning ...` | `warning!(...)` |

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