error is a simple Mush module that prints error messages to stderr, optionally exiting with a status code — Mush-style!
To use error, add it as a dependency in your Manifest.toml:
[dependencies]
error = "*"Using error is extremely easy. Just follow these steps:
- Import the module into your Mush project.
- Call the
errorfunction to print messages tostderr, with optional exit.
# print error to stderr, no exit
$ error "file not found"
error: file not found
# print error to stderr and exit with status code
$ error "syntax error" 1
error: syntax errorextern package error
main() {
error "something went wrong" 2
}
This project is licensed under the MIT License – see the LICENSE file for details.