feat: conditional suggestions

This commit is contained in:
iff 2023-07-31 09:24:46 +02:00
parent 72db07051b
commit 6b4d926dde
5 changed files with 54 additions and 19 deletions

View file

@ -48,8 +48,10 @@ suggest = "{{command[0]}} fix {{command[2:]}}"
pattern = [
"pattern 1",
]
# this will add a `sudo` before the command, without touching the rest
suggest = "sudo {{command}}"
# this will add a `sudo` before the command if the `sudo` is found by `which`
suggest = '''
#[executable(sudo)]
sudo {{command}}'''
```
The placeholder is evaluated as following: