pay-respects/README.md

141 lines
3.4 KiB
Markdown
Raw Normal View History

2023-07-31 21:38:04 +02:00
# Pay Respects
2023-07-30 18:40:18 +02:00
2023-08-04 03:04:26 +02:00
Typed a wrong command? Pay Respects will try to correct your wrong console command by simply pressing `F`!
2023-07-30 18:40:18 +02:00
2023-08-04 03:18:31 +02:00
- 🚀 **Blazing fast suggestion**: You won't notice any delay for asking suggestions!
2024-11-15 20:11:26 +01:00
- ✏️ **Easy to write rules**: You don't need to know Rust. The rules are written in a TOML file that is simple to work with and can be evaluated to Rust code upon compilation! Optional runtime user defined rules can be enabled starting from 0.5!
2023-08-13 17:51:43 +02:00
- 🎯 **Accurate results**: Suggestions must pass several conditions in order to be prompted to the user, no `sudo` suggestions when you are using `doas`!
2023-08-04 03:18:31 +02:00
- 🪶 **Tiny binary size**: Not even 1MB!
2023-08-13 17:51:43 +02:00
![pacman-fix](img/pacman-fix.png)
2023-08-05 00:56:46 +02:00
2023-08-13 17:51:43 +02:00
![cd-fix](img/cd-fix.png)
2023-07-31 19:25:19 +02:00
2023-07-31 21:38:04 +02:00
## How to Pay Respects
2023-07-30 18:40:18 +02:00
Please follow the instruction for your shell:
<details>
<summary>Base / Zsh</summary>
2023-07-31 14:22:20 +02:00
Manual aliasing:
``` shell
alias f="$(pay-respects bash)"
2023-08-05 03:22:05 +02:00
alias f="$(pay-respects zsh)"
```
Auto aliasing (optional custom alias can be added after `--alias argument`):
``` shell
eval "$(pay-respects bash --alias)"
eval "$(pay-respects zsh --alias)"
```
</details>
<details>
<summary>Fish</summary>
2023-07-31 21:12:57 +02:00
Manual aliasing:
``` shell
alias f="$(pay-respects fish)"
```
Auto aliasing (optional custom alias can be added after `--alias argument`):
``` shell
2023-08-05 03:22:05 +02:00
pay-respects fish --alias | source
```
2023-08-04 15:40:45 +02:00
</details>
<details>
<summary>Nushell</summary>
Add the output of the following file to your configuration file:
```
pay-respects nushell [--alias <alias>]
2023-07-30 18:40:18 +02:00
```
Or save it as a file:
```
pay-respects nushell [--alias <alias>] | save -f ~/.pay-respects.nu
```
and source from your config file:
```
source ~/.pay-respects.nu
```
2023-07-31 15:06:30 +02:00
</details>
You can now **press `F` to Pay Respects**!
2024-10-19 16:53:16 +02:00
2023-07-30 22:10:55 +02:00
## Installing
2024-11-16 23:27:35 +01:00
Install from your package manager if available:
[![Packaging status](https://repology.org/badge/vertical-allrepos/pay-respects.svg)](https://repology.org/project/pay-respects/versions)
2023-07-30 22:10:55 +02:00
<details>
<summary>Generic x86 Desktop Linux</summary>
1. Get the latest binary from [releases](https://github.com/iffse/pay-respects/releases).
2024-11-17 14:24:37 +01:00
```shell
curl -sL -o pay-respects.zip \
$(curl -s https://api.github.com/repos/iffse/pay-respects/releases/latest \
| sed 's/[()",{}]/ /g; s/ /\n/g' \
| grep "https.*pay-respects-ubuntu-latest.zip")
```
2024-11-17 15:06:14 +01:00
2. Extract zip, e.g. one of the following:
```shell
2024-11-17 15:06:14 +01:00
7z -x pay-respects.zip
unzip pay-respects.zip
```
2024-11-17 14:24:37 +01:00
3. System-wide installation:
```shell
2024-11-17 14:24:37 +01:00
sudo chmod a+x pay-respects
sudo mv pay-respects /usr/local/bin/pay-respects
```
2024-11-17 15:06:14 +01:00
4. Delete the downloaded package:
```shell
2024-11-17 15:06:14 +01:00
rm pay-respects.zip
2024-11-17 14:24:37 +01:00
```
</details>
<details>
<summary>Compile from source (any OS/architecture)</summary>
This installation requires you to have Cargo (the Rust package manager) installed.
2024-11-17 14:24:37 +01:00
Install from [crates.io](https://crates.io/), `runtime-rules` is optional:
2024-09-24 18:47:31 +02:00
```shell
2024-11-15 20:11:26 +01:00
cargo install pay-respects --features=runtime-rules
```
2024-09-24 18:47:31 +02:00
Clone from git and install, suitable for adding custom compile-time rules:
```
2024-09-24 18:47:31 +02:00
git clone --depth 1 https://github.com/iffse/pay-respects
cd pay-respects
cargo install --path .
```
</details>
2023-07-30 20:08:28 +02:00
## Rule Files
2024-11-15 20:11:26 +01:00
See [writing rules](./rules.md) for how to write rules.
2023-07-30 20:08:28 +02:00
2024-11-15 20:11:26 +01:00
## Contributing
2023-07-30 18:40:18 +02:00
2023-08-04 03:04:26 +02:00
Current option to write rules should cover most of the cases.
We need more rule files, contributions are welcomed!
2023-07-30 18:40:18 +02:00
2024-10-19 18:30:10 +02:00
This project is hosted at various sites, choose the one that suits you best:
- [Codeberg](https://codeberg.org/iff/pay-respects)
- [GitHub](https://github.com/iffse/pay-respects)
- [GitLab](https://gitlab.com/iffse/pay-respects)