Skip to content

Zsh: add comment in [[ ... ]] and other fixes for [[ ... ]]

Jonathan Poelen requested to merge jpoelen/syntax-highlighting:sh into master

Zsh/Bash:

  • first parameter is a text
  • pattern is a path only if it contains /
  [[ x*y   == a[ab] ]
      ^ text  ^ pattern
               ^ glob
  [[ x*y    = a[ab]/a ]
      ^ text  ^ path
               ^ glob
                   ^ path
  • fix parameters that look like unary operators in binary expressions
  [[ -f xxx ]
     ^ expression
  [[ -f == xxx ]
     ^ text

Bash: add globany in Option ; add comment in [[ ... ]] and other fixes for [[ ... ]]

  • add globany in Option
  cmd --my-option[1
      ^ option
  cmd --my-option[1]
      ^ option   ^ glob
  cmd --my-option[1]suffix
      ^ option   ^ glob
                    ^ option
  • fix closing parentheses in binary expression
Edited by Jonathan Poelen

Merge request reports