format: uniform rule style

This commit is contained in:
iff 2023-08-04 02:42:16 +02:00
parent 0646317abc
commit 9be1d040c4
5 changed files with 21 additions and 9 deletions

View file

@ -61,10 +61,12 @@ command = "world"
# note that the error is formatted to lowercase without extra spaces # note that the error is formatted to lowercase without extra spaces
pattern = [ pattern = [
"pattern 1", "pattern 1",
"pattern 2", "pattern 2"
] ]
# this will change the first argument to `fix`, while keeping the rest intact # this will change the first argument to `fix`, while keeping the rest intact
suggest = [ "{{command[0]}} fix {{command[2:]}}" ] suggest = [
"{{command[0]}} fix {{command[2:]}}",
]
[[match_err]] [[match_err]]
pattern = [ pattern = [
@ -76,7 +78,8 @@ pattern = [
suggest = [ suggest = [
''' '''
#[executable(sudo), !cmd_contains(sudo)] #[executable(sudo), !cmd_contains(sudo)]
sudo {{command}}''' sudo {{command}}
'''
] ]
``` ```

View file

@ -7,5 +7,7 @@ pattern = [
"nu::shell::external_command", "nu::shell::external_command",
] ]
suggest = [ suggest = [
'''{{typo[0](path)}} {{command[1:]}}''' '''
{{typo[0](path)}} {{command[1:]}}
'''
] ]

View file

@ -95,7 +95,8 @@ suggest = [
''' '''
#[cmd_contains(pull)] #[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)}}
git pull''' git pull
'''
] ]
[[match_err]] [[match_err]]

View file

@ -30,8 +30,10 @@ pattern = [
suggest = [ suggest = [
''' '''
#[executable(sudo)] #[executable(sudo)]
sudo {{command}}''', sudo {{command}}
''',
''' '''
#[executable(doas)] #[executable(doas)]
doas {{command}}''', doas {{command}}
''',
] ]

View file

@ -3,12 +3,16 @@ command = "rm"
[[match_err]] [[match_err]]
pattern = [ "is a directory", ] pattern = [ "is a directory", ]
suggest = [ suggest = [
'''{{command}} --recursive''' '''
{{command}} --recursive
'''
] ]
[[match_err]] [[match_err]]
pattern = [ "no such file or directory", ] pattern = [ "no such file or directory", ]
suggest = [ suggest = [
'''{{command[0}} {{opt::(?:\s)-[\w]+}} {{typo[-1](file)}}''' '''
{{command[0}} {{opt::(?:\s)-[\w]+}} {{typo[-1](file)}}
'''
] ]