- Aug
- 2,241
- 105
Hi,
While TCC has the ALIAS command to list all currently defined aliases, I find it a bit difficult to read. I have written a simple batch file that lists all currently defined aliases in two columns.
While TCC has the ALIAS command to list all currently defined aliases, I find it a bit difficult to read. I have written a simple batch file that lists all currently defined aliases in two columns.
Code:
@setlocal
@if %_echo eq 1 @echo off
if %@len[%@alias[%1]] eq 0 goto showall
if %@len[%@alias[%1]] gt 0 goto showit
goto eoj
:showit
gosub headers
screen %_row 0 %1
screen %_row 16 %@alias[%1]
goto eoj
:showall
gosub headers
alias > clip:
setdos /X-45678
do theline in @clip:
screen %_row 0 %@word["=",0,%theline]
screen %_row 16 %@alias[%@word["=",0,%theline]]
::
:: If your aliases are too long, you could un-comment the following line;
::
::screen %_row 16 %@left[60,%@word["=",1,%theline]]
::
echo.
enddo
setdos /X0
goto eoj
:headers
screen %_row 0 Name
screen %_row 16 Definition
echo.
screen %_row 0 ----
screen %_row 16 ----------
echo.
return
:eoj
endlocal