-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathechos_macros.bat
80 lines (71 loc) · 1.94 KB
/
echos_macros.bat
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
@echo off
rem https://ss64.com/nt/syntax-macros.html
if "%1"=="export" ( goto:start_bc )
if "%1"=="unset" ( goto:unset )
if not "%1"=="" (
call:unset
setlocal enabledelayedexpansion
)
if "%script_dir%"=="" (
call:unset
setlocal enabledelayedexpansion
)
:start_bc
for %%i in ("%~dp0.") do SET "batdir=%%~fi"
rem @echo "batdir='%batdir%'"
set "_ok=call:call_echos_stack 2>NUL & call "%%batdir%%\echos.bat" :ok"
set "_info=call:call_echos_stack 2>NUL & call "%%batdir%%\echos.bat" :info"
set "_warning=call:call_echos_stack 2>NUL & call "%%batdir%%\echos.bat" :warning"
set "_task=call:call_echos_stack 2>NUL & call "%%batdir%%\echos.bat" :task"
set "_error=call:call_echos_stack 2>NUL & call "%%batdir%%\echos.bat" :error"
set "_fatal=call:call_echos_stack 2>NUL & call "%%batdir%%\echos.bat" :fatal"
set "_stack=call:call_echos_stack"
set "_stack_call=call:call_echos_stack & call"
set "_unstack=call "%%batdir%%\echos.bat" :unstack"
set "_pre=call "%%batdir%%\echos.bat" :pre"
set "_post=call "%%batdir%%\echos.bat" :post"
set "CHECK_DEBUG_ECHOS=echo %DEBUG_ECHOS% | findstr /C:true >nul &&
if "%1"=="" ( goto:eof )
if "%1"=="export" ( goto:eof )
for %%i in ("%~dp0.") do SET "batdir=%%~fi"
echo %batdir%
%_ok% "test msg"
%_info% "test msg"
%_warning% "test msg"
%_task% "test msg"
%_error% "test msg"
%_fatal% "test msg" 3
echo all done macros
goto:eof
:unset
set "_error="
set "_fatal="
set "_info="
set "_ok="
set "_task="
set "_warning="
set "_stack="
set "_unstack="
set "echos_last_stack="
set "echos_nx="
set "echos_stack_list="
set "echos_stack_spaces="
set "count="
set "prefix="
set "CHECK_DEBUG_ECHOS="
set "DEBUG_ECHOS="
set "_stack_call="
set "ECHOS_POST_FILE="
set "ECHOS_PRE_FILE="
set "ECHOS_STACK="
set "echos_stack_dir="
set "echos_stack_emptied="
set "echos_stack_file="
set "echos_stack_list_count="
set "echos_stack_warning="
set "echos_stack_warning_msg="
set "echos_stack_warning_no_stack="
set "batdir="
set "_pre="
set "_post="
goto:eof