2018-03-23 22:20:07 +08:00
|
|
|
@echo off
|
|
|
|
|
|
|
|
set lib_base=call "%~dp0lib_base.cmd"
|
|
|
|
|
|
|
|
if "%~1" == "/h" (
|
2018-05-31 20:35:02 +08:00
|
|
|
%lib_base% help "%~0"
|
2018-03-23 22:20:07 +08:00
|
|
|
) else if "%1" neq "" (
|
|
|
|
call :%*
|
|
|
|
)
|
|
|
|
|
|
|
|
exit /b
|
|
|
|
|
|
|
|
:help
|
|
|
|
:::===============================================================================
|
|
|
|
:::show_subs - shows all sub routines in a .bat/.cmd file with documentation
|
|
|
|
:::.
|
|
|
|
:::include:
|
|
|
|
:::.
|
2018-05-31 20:35:02 +08:00
|
|
|
::: call "lib_base.cmd"
|
2018-03-23 22:20:07 +08:00
|
|
|
:::.
|
|
|
|
:::usage:
|
|
|
|
:::.
|
|
|
|
::: %lib_base% show_subs "file"
|
|
|
|
:::.
|
|
|
|
:::options:
|
|
|
|
:::.
|
|
|
|
::: file <in> full path to file containing lib_routines to display
|
|
|
|
:::.
|
|
|
|
:::-------------------------------------------------------------------------------
|
2018-11-23 04:14:02 +08:00
|
|
|
for /f "tokens=* delims=:" %%a in ('type "%~1" ^| %WINDIR%\System32\findstr /i /r "^:::"') do (
|
2018-03-23 22:20:07 +08:00
|
|
|
rem echo a="%%a"
|
|
|
|
|
|
|
|
if "%%a"=="." (
|
|
|
|
echo.
|
|
|
|
) else if /i "%%a" == "usage" (
|
|
|
|
echo %%a:
|
|
|
|
) else if /i "%%a" == "options" (
|
|
|
|
echo %%a:
|
|
|
|
) else if not "%%a" == "" (
|
|
|
|
echo %%a
|
|
|
|
)
|
|
|
|
)
|
|
|
|
|
|
|
|
pause
|
|
|
|
exit /b
|
2018-09-03 06:32:20 +08:00
|
|
|
|
|
|
|
:cmder_shell
|
|
|
|
:::===============================================================================
|
|
|
|
:::show_subs - shows all sub routines in a .bat/.cmd file with documentation
|
|
|
|
:::.
|
|
|
|
:::include:
|
|
|
|
:::.
|
|
|
|
::: call "lib_base.cmd"
|
|
|
|
:::.
|
|
|
|
:::usage:
|
|
|
|
:::.
|
2018-09-03 07:56:17 +08:00
|
|
|
::: %lib_base% cmder_shell
|
2018-09-03 06:32:20 +08:00
|
|
|
:::.
|
|
|
|
:::options:
|
|
|
|
:::.
|
|
|
|
::: file <in> full path to file containing lib_routines to display
|
|
|
|
:::.
|
|
|
|
:::-------------------------------------------------------------------------------
|
2022-09-09 20:54:25 +08:00
|
|
|
call :detect_comspec %ComSpec%
|
|
|
|
exit /b
|
2022-10-15 17:16:13 +08:00
|
|
|
|
2022-09-09 20:54:25 +08:00
|
|
|
:detect_comspec
|
2022-09-09 21:11:45 +08:00
|
|
|
set CMDER_SHELL=%~n1
|
2019-08-22 18:20:19 +08:00
|
|
|
if not defined CMDER_CLINK (
|
|
|
|
set CMDER_CLINK=1
|
|
|
|
if "%CMDER_SHELL%" equ "tcc" set CMDER_CLINK=0
|
|
|
|
if "%CMDER_SHELL%" equ "tccle" set CMDER_CLINK=0
|
|
|
|
)
|
|
|
|
if not defined CMDER_ALIASES (
|
|
|
|
set CMDER_ALIASES=1
|
|
|
|
if "%CMDER_SHELL%" equ "tcc" set CMDER_ALIASES=0
|
|
|
|
if "%CMDER_SHELL%" equ "tccle" set CMDER_ALIASES=0
|
|
|
|
)
|
2019-10-13 22:07:23 +08:00
|
|
|
exit /b
|
2018-09-03 07:18:59 +08:00
|
|
|
|
2019-10-13 22:07:23 +08:00
|
|
|
:update_legacy_aliases
|
|
|
|
type "%user_aliases%" | %WINDIR%\System32\findstr /i ";= Add aliases below here" >nul
|
|
|
|
if "%errorlevel%" == "1" (
|
|
|
|
echo Creating initial user_aliases store in "%user_aliases%"...
|
|
|
|
if defined CMDER_USER_CONFIG (
|
|
|
|
copy "%user_aliases%" "%user_aliases%.old_format"
|
|
|
|
copy "%CMDER_ROOT%\vendor\user_aliases.cmd.default" "%user_aliases%"
|
|
|
|
) else (
|
|
|
|
copy "%user_aliases%" "%user_aliases%.old_format"
|
|
|
|
copy "%CMDER_ROOT%\vendor\user_aliases.cmd.default" "%user_aliases%"
|
|
|
|
)
|
|
|
|
)
|
2018-09-03 06:32:20 +08:00
|
|
|
exit /b
|