mirror of
https://github.com/TECHNOFAB11/pay-respects.git
synced 2025-12-11 22:10:09 +01:00
rules: add touch; update formats
This commit is contained in:
parent
2f3ba438ea
commit
e214cf24ba
8 changed files with 26 additions and 30 deletions
|
|
@ -6,8 +6,7 @@ pattern = [
|
|||
]
|
||||
suggest = [
|
||||
'''
|
||||
cat {{typo[1](file)}}
|
||||
'''
|
||||
cat {{typo[1](file)}} '''
|
||||
]
|
||||
|
||||
[[match_err]]
|
||||
|
|
@ -16,6 +15,5 @@ pattern = [
|
|||
]
|
||||
suggest = [
|
||||
'''
|
||||
ls {{command[1:]}} --almost-all --color=auto --group-directories-first
|
||||
'''
|
||||
ls {{command[1:]}} --almost-all --color=auto --group-directories-first '''
|
||||
]
|
||||
|
|
|
|||
|
|
@ -9,6 +9,5 @@ pattern = [
|
|||
suggest = [
|
||||
'''
|
||||
#[err_contains(no such file or directory)]
|
||||
mkdir -p {{command[1]}}
|
||||
'''
|
||||
mkdir -p {{command[1]}} '''
|
||||
]
|
||||
|
|
|
|||
|
|
@ -4,10 +4,9 @@ command = "general"
|
|||
pattern = [
|
||||
"command not found",
|
||||
"unknown command",
|
||||
"nu::shell::external_command",
|
||||
"nu::shell::external_command"
|
||||
]
|
||||
suggest = [
|
||||
'''
|
||||
{{typo[0](path)}} {{command[1:]}}
|
||||
'''
|
||||
{{typo[0](path)}} {{command[1:]}} '''
|
||||
]
|
||||
|
|
|
|||
|
|
@ -72,8 +72,7 @@ pattern = [
|
|||
suggest = [
|
||||
'''
|
||||
#[cmd_contains(checkout)]
|
||||
git checkout {{typo[2]({{shell(git branch)}})}}
|
||||
'''
|
||||
git checkout {{typo[2]({{shell(git branch)}})}} '''
|
||||
]
|
||||
|
||||
[[match_err]]
|
||||
|
|
@ -83,8 +82,7 @@ pattern = [
|
|||
suggest = [
|
||||
'''
|
||||
#[cmd_contains(push)]
|
||||
git push --set-upstream origin {{shell(git rev-parse --abbrev-ref HEAD)}}
|
||||
'''
|
||||
git push --set-upstream origin {{shell(git rev-parse --abbrev-ref HEAD)}} '''
|
||||
]
|
||||
|
||||
[[match_err]]
|
||||
|
|
@ -94,8 +92,7 @@ pattern = [
|
|||
suggest = [
|
||||
'''
|
||||
#[cmd_contains(pull)]
|
||||
git pull --set-upstream origin {{shell(git rev-parse --abbrev-ref HEAD)}}
|
||||
'''
|
||||
git pull --set-upstream origin {{shell(git rev-parse --abbrev-ref HEAD)}} '''
|
||||
]
|
||||
|
||||
[[match_err]]
|
||||
|
|
@ -105,6 +102,5 @@ pattern = [
|
|||
suggest = [
|
||||
'''
|
||||
#[cmd_contains(branch)]
|
||||
git checkout {{command[2]}}
|
||||
'''
|
||||
git checkout {{command[2]}} '''
|
||||
]
|
||||
|
|
|
|||
|
|
@ -7,6 +7,5 @@ pattern = [
|
|||
suggest = [
|
||||
'''
|
||||
#[err_contains(no such file or directory)]
|
||||
{{command}} --parents
|
||||
'''
|
||||
{{command}} --parents '''
|
||||
]
|
||||
|
|
|
|||
|
|
@ -25,15 +25,13 @@ pattern = [
|
|||
"updatedb: can not open a temporary file",
|
||||
"use `sudo`",
|
||||
"you don't have access to the history db.",
|
||||
"you don't have write permissions",
|
||||
"you don't have write permissions"
|
||||
]
|
||||
suggest = [
|
||||
'''
|
||||
#[executable(sudo)]
|
||||
sudo {{command}}
|
||||
''',
|
||||
sudo {{command}} ''',
|
||||
'''
|
||||
#[executable(doas)]
|
||||
doas {{command}}
|
||||
''',
|
||||
doas {{command}} '''
|
||||
]
|
||||
|
|
|
|||
|
|
@ -1,18 +1,16 @@
|
|||
command = "rm"
|
||||
|
||||
[[match_err]]
|
||||
pattern = [ "is a directory", ]
|
||||
pattern = [ "is a directory" ]
|
||||
suggest = [
|
||||
'''
|
||||
{{command}} --recursive
|
||||
'''
|
||||
{{command}} --recursive '''
|
||||
]
|
||||
|
||||
[[match_err]]
|
||||
pattern = [ "no such file or directory", ]
|
||||
pattern = [ "no such file or directory" ]
|
||||
suggest = [
|
||||
'''
|
||||
{{command[0}} {{opt::(?:\s)-[\w]+}} {{typo[-1](file)}}
|
||||
'''
|
||||
{{command[0}} {{opt::(?:\s)-[\w]+}} {{typo[-1](file)}} '''
|
||||
]
|
||||
|
||||
|
|
|
|||
9
rules/touch.toml
Normal file
9
rules/touch.toml
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
command = "touch"
|
||||
|
||||
[[match_err]]
|
||||
pattern = [ "No such file or directory" ]
|
||||
suggest = [
|
||||
'''
|
||||
mkdir --parents {{cmd::(?:\s)+(.*[\\\/])(?:\s)*}}
|
||||
touch {{command[1:]}} '''
|
||||
]
|
||||
Loading…
Add table
Add a link
Reference in a new issue