anchor.diff:  
   :: Common paths
   set "PATH=%PATH%;%TEA_HOME%\bin;%TEA_HOME%\var"
  -
  -:: ========================================================================
  -::
  -:: Autoloading from %TEA_HOME%\opt
  -::
  -:: ========================================================================
  -
  -for /d %%d in ( "C:\PROGS\opt\*" ) do call :cmd.env.select.set.path "%%~d"
   
   :: ========================================================================
   ::
  
positive.code: call :cmd.env.set.path "%~1"     "%~2" && goto :EOF
  goto :EOF
  
  
  :cmd.env.set.path
  :: Check if the path is not specified in %PATH% and contains executables
  call :cmd.env.check.path "%~1" || goto :EOF
  
  :: Append or prepend new path to %PATH%
  if /i "%~2" == "/P" (
  	set "PATH=%~1;%PATH%"
  ) else (
  	set "PATH=%PATH%;%~1"
  )
  ::if /i     "%~2" == "/P" set "PATH=%~1;%PATH%"
  ::if /i not "%~2" == "/P" set "PATH=%PATH%;%~1"
  goto :EOF
  
  
  :cmd.env.check.path
  :: Skip if the path is specified in %PATH%
  for %%p in ( "%PATH:;=" "%" ) do if /i "%~1" == "%%~p" exit /b 1
  
negative.code: call :cmd.env.set.path "%~2"         "%~3" && set "%~1=%~2"
  goto :EOF
  
  :: ========================================================================
  
  :: %~1 - the directory's path
  :: %~2 - /P to force prepending to %PATH%, or empty
  :cmd.env.select.set.path
  :: Only one of these paths will be appended to %PATH%
  call :cmd.env.set.path "%~1\bin" "%~2" && goto :EOF
  