home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 11 Util / 11-Util.zip / os2clu02.zip / BIN / Help.CMD < prev    next >
OS/2 REXX Batch file  |  1999-08-31  |  2KB  |  66 lines

  1. /*
  2.  *  ************************************************************************
  3.  *                          OS/2 Command-Line Utilities
  4.  *  (c) Copyright 1991-1999 Jonathan de Boyne Pollard.  All Rights Reserved.
  5.  *  ************************************************************************
  6.  */
  7.  
  8. /* "@(#)HELP.CMD version 1.01" */
  9.  
  10. '@echo off'
  11.  
  12. call RxFuncAdd 'SysGetMessage','RexxUtil','SysGetMessage'
  13.  
  14. usage = "Usage: HELP"||"0D0A"X||"   or: HELP message_number"||"0D0A"X||"   or: HELP [book] command"
  15. copyr = "Copyright (c) 1998-1999 Jonathan de Boyne Pollard.  All Rights Reserved."
  16.  
  17. parse arg first second third
  18.  
  19. select
  20.     when third \== '' then do
  21.         say SysGetMessage(1003)
  22.         say usage
  23.     end
  24.     when second \== '' then
  25.         'start /n view '||first||' '||second
  26.     when translate(first) == "ON" then do
  27.         prompt = value("PROMPT",,"OS2ENVIRONMENT")
  28.         ipos = pos("$i", prompt)
  29.         if ipos < 1 then
  30.             prompt = value("PROMPT","$i"||prompt,"OS2ENVIRONMENT")
  31.     end
  32.     when translate(first) == "OFF" then do
  33.         prompt = value("PROMPT",,"OS2ENVIRONMENT")
  34.         ipos = pos("$i", prompt)
  35.         if ipos > 0 then
  36.             prompt = value("PROMPT",left(prompt,ipos-1)||substr(prompt,ipos+2),"OS2ENVIRONMENT")
  37.     end
  38.     when first == "/?" then do
  39.         say SysGetMessage(50, "CLUH.MSG", copyr, usage)
  40.     end
  41.     when first == '' then do
  42.         say
  43.         say SysGetMessage(1491)
  44.     end
  45.     when datatype(first,"N") then do
  46.         say
  47.         say SysGetMessage(first)
  48.         say SysGetMessage(first, "OSO001H.MSG")
  49.     end
  50.     when datatype(first,"A") & datatype(left(first,3), "M") & datatype(substr(first,4),"N") then do
  51.         file = left(first,3)
  52.         if translate(file) == "SYS" then
  53.             file = "OSO001"
  54.         num = substr(first,4)
  55.         say
  56.         say SysGetMessage(num, file||".MSG")
  57.         say SysGetMessage(num, file||"H.MSG")
  58.     end
  59.     otherwise do
  60.         cmdref = value("CMDREF",,"OS2ENVIRONMENT")
  61.         if cmdref == '' then
  62.             cmdref = 'cmdref'
  63.         'start /n view '||cmdref||' '||first
  64.     end
  65. end
  66.