From 77c6bf2019366a8c4cabd5788f7e0da796cec533 Mon Sep 17 00:00:00 2001 From: Daniel Shahaf Date: Fri, 24 Jan 2020 00:37:56 +0000 Subject: [PATCH] 'main': precommands: Remove argumentless options that can't be followed by a command word. Suggested-by: Matthew Martin (in https://github.com/zsh-users/zsh-syntax-highlighting/commit/e2e97dde9c92bf27d8222482a08e2b77d66ac334#r36941988) --- highlighters/main/main-highlighter.zsh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/highlighters/main/main-highlighter.zsh b/highlighters/main/main-highlighter.zsh index 0ae5a16..6af3f9d 100644 --- a/highlighters/main/main-highlighter.zsh +++ b/highlighters/main/main-highlighter.zsh @@ -315,7 +315,8 @@ _zsh_highlight_highlighter_main_paint() 'doas' aCu:Lns # as of OpenBSD's doas(1) dated September 4, 2016 'nice' n: # as of current POSIX spec 'pkexec' '' # doesn't take short options; immune to #121 because it's usually not passed --option flags - 'sudo' Cgprtu:AEHKPSVbhiklnsv # as of sudo 1.8.21p2 + # Argumentless flags that can't be followed by a command: -e -h -K -k -V -v + 'sudo' Cgprtu:AEHPSbilns # as of sudo 1.8.21p2 'stdbuf' ioe: 'eatmydata' '' 'catchsegv' '' @@ -324,7 +325,8 @@ _zsh_highlight_highlighter_main_paint() # As of OpenSSH 8.1p1; -k is deliberately left out since it may not be followed by a command 'ssh-agent' aEPt:csDd # suckless-tools v44 - 'tabbed' gnprtTuU:cdfhsv + # Argumentless flags that can't be followed by a command: -v + 'tabbed' gnprtTuU:cdfhs ) if [[ $zsyh_user_options[ignorebraces] == on || ${zsyh_user_options[ignoreclosebraces]:-off} == on ]]; then