feat: add have.bat as a wrapper

This commit is contained in:
xiazeyu_2011
2018-05-18 20:32:05 +08:00
parent daa94c5462
commit bf6dae4a24
2 changed files with 118 additions and 11 deletions

20
vendor/init.bat vendored
View File

@ -308,28 +308,26 @@ if not exist "%initialConfig%" (
echo Creating user startup file: "%initialConfig%"
(
echo :: use this file to run your own startup commands
echo :: use in front of the command to prevent printing the command
echo :: use in front of the command to prevent printing the command
echo.
echo :: the next one lines is for "have" shortcut, a custom arguments handler
echo :: don't remove it if you need it
echo set "CMDER_USER_FLAGS=%*"
echo.
echo :: uncomment this to have the ssh agent load when cmder starts
echo :: call "%%GIT_INSTALL_ROOT%%/cmd/start-ssh-agent.cmd"
echo.
echo :: uncomment this next two lines to use pageant as the ssh authentication agent
echo :: uncomment the next two lines to use pageant as the ssh authentication agent
echo :: SET SSH_AUTH_SOCK=/tmp/.ssh-pageant-auth-sock
echo :: call "%%GIT_INSTALL_ROOT%%/cmd/start-ssh-pageant.cmd"
echo.
echo :: you can add your plugins to the cmder path like so
echo :: set "PATH=%%CMDER_ROOT%%\vendor\whatever;%%PATH%%"
echo.
echo :: arguments in this batch are passed from init.bat, you can parse them like so:
echo :: arguments in this batch are passed from init.bat, you can quickly parse them like so:
echo :: more useage can be seen by typing "have /?"
echo.
echo :: echo %* | find /i "/customOption">nul
echo :: if "%ERRORLEVEL%" == "0" (
echo :: echo found /customOption.
echo :: do something.
echo :: ) else (
echo :: echo not found /customOption.
echo :: do something.
echo :: )
echo :: have "/customOption" "your custom command"
echo.
echo @echo off
) >"%initialConfig%"