why (2.0.2)
Installation
[registries.forgejo]
index = "sparse+ " # Sparse index
# index = " " # Git
[net]
git-fetch-with-cli = truecargo add why@2.0.2 --registry forgejoAbout this package
why
Plain English explanations for compiler errors and CLI failures.
Stop staring at cryptic error messages. Just type why.
Demo
What it does
why reads the last error from your terminal and explains it in plain English, what went wrong, why it happened, and how to fix it. No more context-switching to Google or Stack Overflow.
Installation
cargo install --git https://github.com/alexdev-tb/why
Usage
Run why after a failed command to get an explanation of the error:
why
Look up a specific error code directly:
why ErrorCode
Browse all supported error codes:
why --list
Set up the shell hook for automatic error capture:
why --setup
Shell Hook Setup
The shell hook captures the output of failed commands automatically so why can read them. Run why --setup for automatic setup, or add the hook manually:
Bash
Add to your ~/.bashrc:
eval "$(why --hook bash)"
Zsh
Add to your ~/.zshrc:
eval "$(why --hook zsh)"
Then restart your shell or run source ~/.bashrc (or ~/.zshrc).
Contributing
Contributions are encouraged! Adding a new error explanation is as simple as copying a YAML template and writing a few sentences of plain English.
See CONTRIBUTING.md for the full guide.
License
Dependencies
| ID | Version |
|---|---|
| clap | ^4 |
| colored | ^2 |
| dirs | ^5 |
| flate2 | ^1 |
| include_dir | ^0.7 |
| regex | ^1 |
| serde | ^1 |
| serde_yaml | ^0.9 |
| tar | ^0.4 |
| ureq | ^2 |
| assert_cmd | ^2 |
| predicates | ^3 |