home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC World Komputer 1995 November
/
PCWK1195.iso
/
inne
/
podstawy
/
dos
/
4dos
/
4uzytki
/
4whts10b.exe
/
WHATIS.BTM
next >
Wrap
Text File
|
1992-10-20
|
3KB
|
123 lines
@echo off^goto start
rem WHATIS 1.0ß by Jouni Vääriskoski (vaarisko@tnclus.tele.nokia.fi)
:help
text
WHATIS - tries to find out what the given command stands for. Version 1.0ß
Usage: WHATIS [/l] <command>
WHATIS searches for internal 4dos commands, aliases, external programs
and executable extensions.
If a name of an existing .BAT or .BTM file is given and the /l switch
is used WHATIS calls LIST to view the file.
Using wildcards (other than leading '*') in <command> forces WHATIS to
search for external program files only. The path of the first matching
filename is used, and all matching files in that directory are processed.
Note: In most cases, "WHATIS list.com" leads to an internal 4dos command
"list", since it is the way used by 4DOS when parsing command lines.
endtext
return
:start
if "%debug" eq "%0" echo on
if %_env lt 150 (echo %@upper[%0]: Not enough free environment space!^quit)
setlocal
set list=0
:arg_parsing
if "%1" eq "" (gosub help^set Err=2^goto cleanup)
set arg=%1
iff %@index[-/,%@substr[%arg,0,1]] ne -1 then
set arg=%@lower[%@substr[%arg,1]]
iff "%arg" eq "?" then
gosub help^goto cleanup
elseiff %arg eq l then
shift
set list=1
goto arg_parsing
else
echo %@upper[%0]: Invalid switch "/%arg"
(set Err=2^goto cleanup)
endiff
endiff
set ex=%@upper[%@ext[%1]]
if %@index[%1,.] ge 0 set ex=.%ex
set pa=%@upper[%@path[%1]]
set targ=%@upper[%@name[%1]]
echo.
if "%ex" == "" goto noext
if %ex == .COM .or. %ex == .EXE .or. %ex == .BTM .or. %ex == .BAT goto catext
iff "%[%ex]" ne "" then
echo Executable extension = %@upper[%[%ex]]
iff "%@path[%[%ex]]" == "" then
where %@name[%[%ex]].%@ext[%[%ex]]
endiff
iff not exist %[%ey] then
echo Extension program not found
endiff
else
iff exist %1 then
echo %@upper[%1] is not an executable file.
else
echo Executable extension or file not found.
endiff
endiff
goto cleanup
:catext
set targ=%targ%%ex%
:noext
iff isalias %targ then
echo 4dos Alias:
alias %targ
goto cleanup
endiff
REM Note: Remove leading "*", if found ("isinternal *dir" returns false!).
iff %@substr[%targ,0,1] eq * then
set targ=%@substr[%targ,1]
endiff
iff isinternal %pa%%targ% then
REM Note: Above the path, if given, must be included, othervise command
REM like "MAN c:\util\list.com" would go into the next iff, because
REM "isinternal LIST.COM" returns TRUE! (Bug in 4dos?)
echo Internal 4dos command
goto cleanup
endiff
iff exist %1 then
set targ=%1
else
set targ=%@search[%targ]
endiff
iff "%targ" ne "" then
for %targ in (%targ) do (
echos %@upper[%targ]
set desc=%@descript[%targ%]
iff "%desc" ne "" then
echo - %desc
else
echo - no file description.
endiff
if %list eq 1 .and. %@index[.bat.btm,.%@ext[%targ]] ne -1 list %targ
)
else
echo %@upper[%0]: Not a command, not a file - Check spelling
(set Err=2^goto cleanup)
endiff
:cleanup
quit %Err