cmder/vendor/lib/lib_console.cmd

80 lines
1.6 KiB
Batchfile
Raw Normal View History

@echo off
rem set args=%*
call "%~dp0lib_base.cmd"
set lib_console=call "%~dp0lib_console.cmd"
if "%~1" == "/h" (
%lib_base% help "%~0"
) else if "%1" neq "" (
call :%*
)
exit /b
2018-09-02 11:08:00 +08:00
:debug_output
:::===============================================================================
2018-09-02 11:08:00 +08:00
:::debug_output - Output a debug message to the console.
:::.
:::include:
:::.
::: call "lib_console.cmd"
:::.
:::usage:
:::.
2018-09-02 11:08:00 +08:00
::: %lib_console% debug_output [caller] [message]
:::.
:::required:
:::.
2018-09-02 11:08:00 +08:00
::: [caller] <in> Script/sub routine name calling debug_output
:::.
::: [message] <in> Message text to display.
:::.
:::-------------------------------------------------------------------------------
2018-09-02 11:08:00 +08:00
if %debug_output% gtr 0 echo DEBUG(%~1): %~2 & echo.
exit /b
2018-09-02 11:08:00 +08:00
:verbose_output
:::===============================================================================
2018-09-02 11:08:00 +08:00
:::verbose_output - Output a debug message to the console.
:::.
:::include:
:::.
::: call "$0"
:::.
:::usage:
:::.
2018-09-02 11:08:00 +08:00
::: %lib_console% verbose_output "[message]"
:::.
:::required:
:::.
::: [message] <in> Message text to display.
:::.
:::-------------------------------------------------------------------------------
2018-09-02 11:08:00 +08:00
if %verbose_output% gtr 0 echo %~1
exit /b
:show_error
:::===============================================================================
:::show_error - Output an error message to the console.
:::.
:::include:
:::.
::: call "$0"
:::.
:::usage:
:::.
::: %lib_console% show_error "[message]"
:::.
:::required:
:::.
::: [message] <in> Message text to display.
:::.
:::-------------------------------------------------------------------------------
echo ERROR: %~1
exit /b