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
|
|
|
|
:::.
|
|
|
|
:::-------------------------------------------------------------------------------
|
|
|
|
for /f "tokens=* delims=:" %%a in ('type "%~1" ^| findstr /i /r "^:::"') do (
|
|
|
|
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
|