Subversion Repositories SvarDOS

Rev

Rev 1647 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
281 mateuszvis 1
@ECHO OFF
1647 bttr 2
REM :: NO PARAMS GIVEN?
3
IF "%1"=="" GOTO USERGUIDE
4
 
5
REM :: HELP ON HELP WANTED?
6
IF %1==/? GOTO HELPONHELP
7
 
8
REM :: UPCASE PARAM #1
9
SET OLDPATH=%PATH%
10
PATH %1
11
SET COMMAND=%PATH%
12
PATH %OLDPATH%
13
SET OLDPATH=
14
 
1650 bttr 15
REM :: SPECIAL CASE
16
IF %COMMAND%==HELP GOTO HELPONHELP
17
 
1647 bttr 18
REM :: ANY SVARCOM INTERNAL COMMAND?
19
REM :: ALL UNDERSTAND THE /? SYNTAX
20
IF %COMMAND%==BREAK    GOTO RUNCOMMANDHELP
21
IF %COMMAND%==CALL     GOTO RUNCOMMANDHELP
22
IF %COMMAND%==CD       GOTO RUNCOMMANDHELP
23
IF %COMMAND%==CHDIR    GOTO RUNCOMMANDHELP
24
IF %COMMAND%==CHCP     GOTO RUNCOMMANDHELP
25
IF %COMMAND%==CLS      GOTO RUNCOMMANDHELP
26
IF %COMMAND%==COPY     GOTO RUNCOMMANDHELP
27
IF %COMMAND%==DATE     GOTO RUNCOMMANDHELP
28
IF %COMMAND%==DEL      GOTO RUNCOMMANDHELP
29
IF %COMMAND%==ERASE    GOTO RUNCOMMANDHELP
30
IF %COMMAND%==DIR      GOTO RUNCOMMANDHELP
31
IF %COMMAND%==ECHO     GOTO RUNCOMMANDHELP
32
IF %COMMAND%==EXIT     GOTO RUNCOMMANDHELP
33
IF %COMMAND%==FOR      GOTO RUNCOMMANDHELP
34
IF %COMMAND%==GOTO     GOTO RUNCOMMANDHELP
35
IF %COMMAND%==IF       GOTO RUNCOMMANDHELP
36
IF %COMMAND%==LN       GOTO RUNCOMMANDHELP
37
IF %COMMAND%==MD       GOTO RUNCOMMANDHELP
38
IF %COMMAND%==MKDIR    GOTO RUNCOMMANDHELP
39
IF %COMMAND%==PATH     GOTO RUNCOMMANDHELP
40
IF %COMMAND%==PAUSE    GOTO RUNCOMMANDHELP
41
IF %COMMAND%==PROMPT   GOTO RUNCOMMANDHELP
42
IF %COMMAND%==RD       GOTO RUNCOMMANDHELP
43
IF %COMMAND%==RMDIR    GOTO RUNCOMMANDHELP
44
IF %COMMAND%==REM      GOTO RUNCOMMANDHELP
45
IF %COMMAND%==REN      GOTO RUNCOMMANDHELP
46
IF %COMMAND%==RENAME   GOTO RUNCOMMANDHELP
47
IF %COMMAND%==SET      GOTO RUNCOMMANDHELP
48
IF %COMMAND%==SHIFT    GOTO RUNCOMMANDHELP
49
IF %COMMAND%==TIME     GOTO RUNCOMMANDHELP
50
IF %COMMAND%==TRUENAME GOTO RUNCOMMANDHELP
51
IF %COMMAND%==TYPE     GOTO RUNCOMMANDHELP
52
IF %COMMAND%==VER      GOTO RUNCOMMANDHELP
53
IF %COMMAND%==VERIFY   GOTO RUNCOMMANDHELP
54
IF %COMMAND%==VOL      GOTO RUNCOMMANDHELP
55
 
56
REM :: LOOKUP HELP FILE FOR ANY EXTERNAL COMMANDS
1650 bttr 57
IF EXIST %DOSDIR%\HELP\EN\%COMMAND%.AMB SET AMBFILE=EN\%COMMAND%
58
IF EXIST %DOSDIR%\HELP\%LANG%\%COMMAND%.AMB SET AMBFILE=%LANG%\%COMMAND%
1647 bttr 59
REM :: PARAM #2 BECOMES PARAM #1 TO SPECIFY CHAPTER NAME
60
IF NOT "%AMBFILE%"=="" SHIFT
61
IF NOT "%AMBFILE%"=="" GOTO RUNAMB
62
 
63
REM :: EXTERNAL (CORE) COMMAND PRESENT?
64
IF EXIST %DOSDIR%\%COMMAND%.COM GOTO RUNCOMMANDHELP
65
IF EXIST %DOSDIR%\%COMMAND%.EXE GOTO RUNCOMMANDHELP
66
IF EXIST %DOSDIR%\BIN\%COMMAND%.COM GOTO RUNCOMMANDHELP
67
IF EXIST %DOSDIR%\BIN\%COMMAND%.EXE GOTO RUNCOMMANDHELP
68
 
69
:USERGUIDE
70
REM :: LOOKUP HELP FILE FOR SVARDOS USER GUIDE
71
REM :: PARAM #1 SPECIFIES CHAPTER NAME
1650 bttr 72
IF EXIST %DOSDIR%\HELP\HELP-EN.AMB SET AMBFILE=HELP-EN
73
IF EXIST %DOSDIR%\HELP\HELP-%LANG%.AMB SET AMBFILE=HELP-%LANG%
1647 bttr 74
IF NOT "%AMBFILE%"=="" GOTO RUNAMB
75
 
76
ECHO SORRY! NO HELP AVAILABLE
281 mateuszvis 77
GOTO DONE
78
 
1647 bttr 79
:HELPONHELP
80
ECHO HELP [COMMAND] [CHAPTER]
81
GOTO DONE
281 mateuszvis 82
 
1647 bttr 83
:RUNCOMMANDHELP
84
%COMMAND% /?
85
GOTO DONE
86
 
87
:RUNAMB
1650 bttr 88
AMB %DOSDIR%\HELP\%AMBFILE%.AMB %1
1647 bttr 89
 
281 mateuszvis 90
:DONE
1647 bttr 91
SET COMMAND=
92
SET AMBFILE=