unit helper;

interface

{Change log:
13 May 89, V1.1: Added SET INTERFACE, COMMENT, and "client" helps   RTC
26 Apr 89, V1.1: minor cleanups   RTC
13 Apr 89, V1.1: Added Version message         RTC
14 Aug 88: Added command helps for SET SYSTEM command      RTC
14 Aug 88: Added LOG and CLOSE help commands         RTC
31 Jul 88: Minor cleanups of help messages      RTC
30 Jun 88: Added -NAMES, -TYPE, and TAKE command helps   RTC

}

   procedure help;
 
   procedure hlp_version;
 

implementation

uses {$U kermglob.code} kermglob;

const
  my_version = '   Helper Unit V1.1, 13 May 89';

procedure keypress;

var ch: char;

  begin
    write('---------------Press any key to continue---------------');
    read( keyboard, ch );
    page(output); {SP}
  end; (* keypress *)

procedure help1;

  var ch: char;

  begin { help1 }
    if (noun = nullsym) then begin
      writeln('KERMIT is a family of  programs that do reliable file transfer');
      writeln('between computers over TTY lines.',
              '  KERMIT can also be used to make the ');
      writeln('microcomputer behave as a terminal',
              ' for a mainframe.  These are the ');
      writeln('commands for the UCSD p-System version, KERMIT-UCSD:');
      writeln
    end; (* if *)

    if (noun = nullsym) or (noun = consym) then begin
      writeln('  CONNECT     To make a "virtual terminal" connection to a remote');
      writeln('':14, 'system.');
      writeln;
      writeln('':14, 'To break the connection and "escape" back to the micro,');
      writeln('':14, 'type the escape sequence (CTRL-] C, that is Control ');
      writeln('':14, 'rightbracket followed immediately by the letter C.)');
      writeln;
    end; (* if *)

    if (noun = nullsym) or (noun = exitsym) then begin
      writeln('  EXIT        To return back to main command level of the p-system.');
    end; (* if *)

    if (noun = nullsym) or (noun = quitsym) then begin
      writeln('  QUIT        Same as EXIT.');
      writeln;
    end; (* if *)

    if (noun = nullsym) or (noun = helpsym) then begin
      writeln('  HELP        To get a list of KERMIT commands.');
      writeln;
    end; (* if *)

    if (noun = nullsym) or (noun = recsym) then begin
      writeln('  RECEIVE     To accept a file from the remote system.');
    end; (* if *)
 
    if (noun = nullsym) or (noun = sendsym) then begin
      writeln('  SEND        To send a file or group of files to the remote system.');
    end; (* if *)

    if (noun = nullsym) or (noun = getsym) then begin
      writeln('  GET         To request a file from a remote Kermit in SERVER mode.');
    end; (* if *)

    if (noun = nullsym) or (noun = putsym) then begin
      writeln('  PUT         To send a file to a remote Kermit in SERVER mode.');
      writeln;
    end; (* if *)

    if (noun = nullsym) or (noun = byesym) then begin
      writeln('  BYE         Shutdown and logout a remote Kermit in SERVER mode.');
    end; (* if *)

    if (noun = nullsym) or (noun = finsym) then begin
      writeln('  FINISH      Shutdown a remote Kermit in SERVER mode.');
    end; (* if *)

    if (noun = nullsym) then
        keypress;
  end; (* help1 *)

procedure help2;

var ch: char;

  begin { help2 }
    if (noun = nullsym) or (noun = setsym) then begin
      writeln('  SET         To establish system-dependent parameters.  The ');
      writeln('':14, 'SET options are as follows: ');
      writeln;
      if (adj = nullsym) or (adj = debugsym) then begin
        writeln('':14, 'DEBUG            To set debug mode ON or OFF ');
        writeln('':31, '(default is OFF).');
        writeln;
      end; (* if *)
      if (adj = nullsym) or (adj = escsym) then begin
        writeln('':14, 'ESCAPE           To change the escape sequence that ');
        writeln('':31, 'lets you return to the PC Kermit from');
        writeln('':31, 'the remote host.  The default is CTRL-] c.');
        writeln;
      end; (* if *)
      if (adj = nullsym) or (adj = filenamsym) then begin
        writeln('':14, 'FILE-NAMES       LITERAL/CONVERTED, Default is CONVERTED, ');
        writeln('':31, 'In this Kermit LITERAL Names have');
        writeln('':31, 'Volume name Stripped, while CONVERTED');
        writeln('':31, 'Names also have all but the final');
        writeln('':31, '''.'' removed.');
        writeln;
      end; (* if *)
      if (adj = nullsym) or (adj = filetypesym) then begin
        writeln('':14, 'FILE-TYPE        BINARY/TEXT Default is TEXT.');
        writeln;
      end; (* if *)
      if (adj = nullsym) or (adj = filewarnsym) then begin
        writeln('':14, 'FILE-WARNING     ON/OFF, default is OFF.  If ON, ');
        writeln('':31, 'Kermit will warn you and rename an incoming ');
        writeln('':31, 'file so as not to write over a file that ');
        writeln('':31, 'currently exists with the same name');
        writeln;
      end; (* if *)
      if (adj = nullsym) then
        keypress;
    end; (* if *)
  end; (* help2 *)

procedure help3;

  begin
    if (noun = nullsym) or (noun = setsym) then begin
      if (adj = nullsym) or (adj = baudsym) then begin
        writeln('':14, 'BAUD             To set the serial baud rate.' );
        writeln('':31, 'Choices are dependant on your Hardware.' );
        writeln('':31, 'The default is 1200.');
        writeln;
      end; (* if *)
      if (adj = nullsym) or (adj = ibmsym) then begin
        writeln('':14, 'IBM              ON/OFF, default is OFF.  This flag ');
        writeln('':31, 'should be ON only when transfering files');
        writeln('':31, 'between the micro and an IBM VM/CMS');
        writeln('':31, 'system.  It also causes the parity to');
        writeln('':31, 'be set appropriately (mark) and activates');
        writeln('':31, 'local echoing');
        writeln;
      end; (* if *)
      if (adj = nullsym) or (adj = intsym) then begin
        writeln('':14, 'INTERFACE        KERMIT/UCSD, default is KERMIT.');
        writeln('':31, 'Permits selection of prefered User Interface:');
        writeln('':31, 'KERMIT command line or UCSD menus.');
        writeln;
      end; (* if *)

      if (adj = nullsym) or (adj = localsym) then begin
        writeln('':14, 'LOCAL-ECHO       ON/OFF, default is OFF.  This sets the');
        writeln('':31, 'duplex.  It should be ON when using ');
        writeln('':31, 'the IBM and OFF for the DEC-20.');
        writeln;
      end; (* if *)

      if (adj = nullsym) or (adj = emulatesym) then begin
        writeln('':14, 'EMULATE          ON/OFF, default is OFF.  This sets the');
        writeln('':31, 'DataMedia 1520A terminal emulation on or off.');
        writeln;
      end; (* if *)
      if (adj = nullsym) then
        keypress;
    end; (* if *)
  end; (* help3 *)

procedure help4;

  begin
    if (noun = setsym) or (noun = nullsym) then begin
      if (adj = nullsym) or (adj = systemsym) then begin
        writeln('':14, 'SYSTEM-ID        Specify the System-ID for your REMUNIT');
        writeln('':31, 'if your REMUNIT needs it specified.');
        writeln('':31, 'Called "model" in the REMUNIT specs.');
        writeln('':31, 'Default System-ID is UNKNOWN');
        writeln;
      end; (* if *)

      if (adj = nullsym) or (adj = paritysym) then begin
        writeln('':14, 'PARITY           EVEN, ODD, MARK, SPACE, or NONE.');
        writeln('':31, 'NONE is the default but if the IBM ');
        writeln('':31, 'flag is set, parity is set to MARK.  ');
        writeln('':31, 'This flag selects the parity for ');
        writeln('':31, 'outgoing and incoming characters during');
        writeln('':31, 'CONNECT and file transfer to match the');
        writeln('':31, 'requirements of the host.');
        writeln;
      end; (* if *)
    end; (* if *)
    if (noun = nullsym) or (noun = showsym) then begin
      writeln('  SHOW        To see the values of parameters that can be modified');
      write('':14, 'via the SET command. ');
      if (adj in [paritysym, localsym, ibmsym, escsym, debugsym,
                  filenamsym, filetypesym, filewarnsym, baudsym,
                  emulatesym, systemsym, nullsym]) then begin
        writeln('For an explanation of the parameter,');
        writeln('':14, 'see the help for the matching SET command.'); write('':14)
      end; (* if *)
      if (adj in [allsym, versionsym, nullsym]) then begin
        writeln('Additional SHOW options are as follows:');
      end; (* if *)
      writeln;
      if (adj = nullsym) or (adj = allsym) then begin
        writeln('':14, 'ALL              Show all parameters.');
        writeln;
      end; (* if *)
      if (adj = nullsym) or (adj = versionsym) then begin
        writeln('':14, 'VERSION          Show version information.');
        writeln;
      end; (* if *)
    end; (* if *)
    if (noun = nullsym) then
        keypress;

    if (noun = nullsym) or (noun = takesym) then begin
      writeln('  TAKE        This command instructs Kermit to take further');
      writeln('':14, 'commands from a specified file.');
    end; (* if *)
    if (noun = nullsym) or (noun = comsym) then begin
      writeln('  COMMENT     Comments a TAKE file. (ignored)');
      writeln;
    end; (* if *)
    if (noun = nullsym) or (noun = logsym) then begin
      writeln('  LOG         This command opens a selected log file.');
      writeln('':14, 'LOG options are as follows:');
      writeln;
      if (adj = nullsym) or (adj = debugsym) then begin
        writeln('':14, 'DEBUG            open specified file for debug output.');
        writeln;
      end; (* if *)
    end; (* if *)
    if (noun = nullsym) or (noun = closesym) then begin
      writeln('  CLOSE       This command closes a selected log file previously');
      writeln('':14, 'opened via the LOG command.');
    end; (* if *)
  end; (* help4 *)

procedure help;
begin
  help1;
  help2;
  help3;
  help4
end; (* help *)

procedure hlp_version;
 
  begin
    writeln(my_version)
  end {hlp_version};

end. { unit helper }
