From 20d250d6186c0147afc68930ab5887bc056549a9 Mon Sep 17 00:00:00 2001 From: Daniel Shahaf Date: Mon, 16 Mar 2020 19:21:31 +0000 Subject: [PATCH] 'main': Support the non-precommand flags of sudo(8) and ssh-agent(1). Uses the infrastructure added in the previous commit. Fixes #678. --- highlighters/main/main-highlighter.zsh | 8 ++++---- highlighters/main/test-data/precommand-killing2.zsh | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/highlighters/main/main-highlighter.zsh b/highlighters/main/main-highlighter.zsh index ac34f23..b60db29 100644 --- a/highlighters/main/main-highlighter.zsh +++ b/highlighters/main/main-highlighter.zsh @@ -329,15 +329,15 @@ _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 - # 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 + # Not listed: -h, which has two different meanings. + 'sudo' Cgprtu:AEHPSbilns:eKkVv # as of sudo 1.8.21p2 'stdbuf' ioe: 'eatmydata' '' 'catchsegv' '' 'nohup' '' 'setsid' :wc - # As of OpenSSH 8.1p1; -k is deliberately left out since it may not be followed by a command - 'ssh-agent' aEPt:csDd + # As of OpenSSH 8.1p1 + 'ssh-agent' aEPt:csDd:k # suckless-tools v44 # Argumentless flags that can't be followed by a command: -v 'tabbed' gnprtTuU:cdfhs diff --git a/highlighters/main/test-data/precommand-killing2.zsh b/highlighters/main/test-data/precommand-killing2.zsh index 71591f1..bc6fc86 100644 --- a/highlighters/main/test-data/precommand-killing2.zsh +++ b/highlighters/main/test-data/precommand-killing2.zsh @@ -35,5 +35,5 @@ BUFFER='sudo -e /does/not/exist' expected_region_highlight=( '1 4 precommand' # sudo '6 7 single-hyphen-option' # -e - '9 23 default "issue #678"' # /does/not/exist + '9 23 default' # /does/not/exist )