Skip to content

Commit 20d250d

Browse files
committed
'main': Support the non-precommand flags of sudo(8) and ssh-agent(1).
Uses the infrastructure added in the previous commit. Fixes #678.
1 parent c73153c commit 20d250d

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

highlighters/main/main-highlighter.zsh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -329,15 +329,15 @@ _zsh_highlight_highlighter_main_paint()
329329
'doas' aCu:Lns # as of OpenBSD's doas(1) dated September 4, 2016
330330
'nice' n: # as of current POSIX spec
331331
'pkexec' '' # doesn't take short options; immune to #121 because it's usually not passed --option flags
332-
# Argumentless flags that can't be followed by a command: -e -h -K -k -V -v
333-
'sudo' Cgprtu:AEHPSbilns # as of sudo 1.8.21p2
332+
# Not listed: -h, which has two different meanings.
333+
'sudo' Cgprtu:AEHPSbilns:eKkVv # as of sudo 1.8.21p2
334334
'stdbuf' ioe:
335335
'eatmydata' ''
336336
'catchsegv' ''
337337
'nohup' ''
338338
'setsid' :wc
339-
# As of OpenSSH 8.1p1; -k is deliberately left out since it may not be followed by a command
340-
'ssh-agent' aEPt:csDd
339+
# As of OpenSSH 8.1p1
340+
'ssh-agent' aEPt:csDd:k
341341
# suckless-tools v44
342342
# Argumentless flags that can't be followed by a command: -v
343343
'tabbed' gnprtTuU:cdfhs

highlighters/main/test-data/precommand-killing2.zsh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,5 +35,5 @@ BUFFER='sudo -e /does/not/exist'
3535
expected_region_highlight=(
3636
'1 4 precommand' # sudo
3737
'6 7 single-hyphen-option' # -e
38-
'9 23 default "issue #678"' # /does/not/exist
38+
'9 23 default' # /does/not/exist
3939
)

0 commit comments

Comments
 (0)