home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 18 REXX / 18-REXX.zip / cmdpk164.zip / profile.shl < prev    next >
Text File  |  1998-01-10  |  6KB  |  84 lines

  1. /* This is CommandPak's default profile.                */
  2. /* (W) 1997-98 Martin Lafaix, Ulrich Möller             */
  3.  
  4. /* WARNING: This file is necessary for incorporating CommandPak's     */
  5. /* functions into CmdShl. Edit with care.                             */
  6.  
  7. /* This is an UNCOMMENTED version of profilec.shl to speed up         */
  8. /* processing. See the online reference for details.                  */
  9.  
  10. parse Source . . myFile; call charout , myFile': Entering profile... '
  11. history = expand('%TMP%\history.shl'); global = global 'history'
  12. 'ALIAS LOADHIST=RX call charout , "Loading history..."; drop prevLine.; i = 0; do while lines(history); i = i+1; prevLine.i = linein(history); end; prevLine.0 = i; call stream history, "c", "close"; say " done."'
  13. 'ALIAS SAVEHIST=RX call charout , "  Saving history..."; "@if exist" history "del /f" history; xx = (prevLine.0)-100; if (xx<1) then xx=1; do i = xx to prevline.0; call lineout history, prevLine.i; end; call stream history, "c", "close" ; say " done."'
  14. exitList = 'SAVEHIST'; global = global 'exitList'
  15. 'ALIAS exit=RX call charout , "Exiting..."; call eval(exitList); "exit"'
  16. S_F7 = '005A'x; C_CURU = '008D'x; C_CURD = '0091'x; C_PADPLUS = '0090'x; A_F4 = '006b'x
  17. 'DEFINE F3 SHELL exit'
  18. 'DEFINE A-F4 SHELL exit'
  19. 'DEFINE F2 OSNOWAIT SAVEHIST'
  20. 'DEFINE F5 OSNOWAIT LOADHIST'
  21. 'DEFINE F7 OSNOWAIT RX call charout ,"1b"x"[s"||"1b"x"[0;0H"||"1b"x"[1;37;42m"||"1b"x"[KNew history name: "; history=getLine(history); call charout ,"1b"x"[0;0H"||"1b"x"[0;34;47m"||"1b"x"[K"helpstring"1b"x"[0m"||"1b"x"[u"'
  22. 'LOADHIST'
  23. C_F = '06'x; C_R = '12'x; global = global 'item'; item = ''
  24. 'DEFINE C-R OSN RX oldLine=currLine;call charout ,"1b"x"[s"||"1b"x"[0;0H"||"1b"x"[1;37;42m"||"1b"x"[KSearch for: "; item=getLine(item); call charout ,"1b"x"[0;0H"||"1b"x"[0;34;47m"||"1b"x"[K"helpstring"1b"x"[0m"||"1b"x"[u";',
  25.            'if item \= "" then do;prevLine.0=prevLine.0-1;currLine=oldLine-1;if currLine=0 then currLine=prevLine.0;do prevLine.0 while pos(item,prevLine.currLine) = 0;currLine = currLine-1;',
  26.            'if currLine=0 then currLine=prevLine.0;end;if pos(item,prevLine.currLine) \= 0 then line=prevLine.currLine;currOfs=length(line);xOfs=0;end'
  27. 'DEFINE C-F OSN RX if item\="" then do; oldCur=currLine;currLine = currLine-1;if currLine = 0 then currLine=prevLine.0;',
  28.            'do prevLine.0 while pos(item,prevLine.currLine) = 0;currLine = currLine-1;if currLine=0 then currLine=prevLine.0;end;if pos(item,prevLine.currLine) \= 0 then line=prevLine.currLine;currOfs=length(line);xOfs=0; end'
  29. scr.0 = 0; global = global 'scr.'
  30. 'ALIAS PUSHSCR=RX i = scr.0 + 1; scr.i._C = SysCurPos(); scr.i._P = currOfs origRow origCol; scr.i._L = line; scr.i._S = VioReadCellStr(0,0); scr.i._O = oldDir; scr.i._D = directory(); scr.0 = i'
  31. 'ALIAS POPSCR=RX i = scr.0; if i > 0 then do; call VioWrtCellStr 0,0,scr.i._S; line = scr.i._L; call SysCurPos word(scr.i._c,1), word(scr.i._c,2); parse var scr.i._P currOfs origRow origCol; oldDir = scr.i._O; call directory scr.i._D; scr.0 = i-1; end'
  32. 'ALIAS SWAPTMPSCR=RX i = scr.0 + 1; scr.i._C = scr._C; scr.i._P = scr._P; scr.i._L = scr._L; scr.i._S = scr._S; scr.i._O = scr._O; scr.i._D = scr._D; scr.0 = i'
  33. 'ALIAS SWAPSCR=RX if scr.0 > 0 then do; scr._C = SysCurPos(); scr._P = currOfs origRow origCol; scr._L = line; scr._S = VioReadCellStr(0,0); scr._O = oldDir; scr._D = directory(); call eval "POPSCR & SWAPTMPSCR"; end'
  34. 'DEFINE C-CURD SHELL PUSHSCR'
  35. 'DEFINE C-CURU SHELL POPSCR'
  36. 'DEFINE C-PADPLUS SHELL SWAPSCR'
  37. 'DEFINE C-K MC /dup/tab'
  38. 'DEFINE (  MC /TEXT ()/cleft'
  39. 'DEFINE F8 SHELL RX line = insert(date(),line,currOfs); currOfs = currOfs+length(date())'
  40. 'DEFINE S-F7 osn rx if currTab = 0 then currTab = findcontextcompletion(); if currTab \= 0 then do; say; do i = 1 to tree.0; say tree.i; end; call charout, print(); oline=""; parse value SysCurPos() with origRow origCol .; key="tab"; end'
  41. 'ALIAS recurse=rx rargs = "%*"; if ((rargs="") | left(rargs, 1)="-") then "call xhelp recurse";',
  42.            'else do; signal on halt; rcurd = directory(); Call charout ,"Collecting directories... "; call SysFileTree "*", dirs ,"DSO"; Say "Done.";',
  43.            'do i_ = 1 to dirs.0; signal on halt; say "["dirs.i_"] >"rargs; call directory dirs.i_; call eval rargs" ^& rx needCR=0"; end; call directory rcurd; end; '
  44. 'ALIAS rec=recurse %*'
  45. 'ALIAS open=rx what = "%*"; ocurd = directory(); if (left(what, 1)="-") then "call xhelp open"; else do; if (what = "") then what = ocurd;',
  46.            'signal on halt; call eval "cd" what; call charout , "Trying to open "directory()"... "; ',
  47.            'if SysSetObjectData(directory(),"OPEN=DEFAULT") then say "OK."; else say "failed."; call directory ocurd; end '
  48. 'RULE open=%d'
  49. 'ALIAS netscape=rx url=stream("%1", "c", "query exists"); if url="" then call eval("start netscape.exe %1"); else call eval("start netscape.exe" url)'
  50. 'ALIAS loop=rx do %*'
  51. 'ALIAS qd=query date'
  52. 'ALIAS qt=query time'
  53. 'RULE WHENCE=%f %e'
  54. 'RULE recurse=%x'
  55. 'SET DIRCLR.ATTRIB=D:cyan;S,R,H:on red'
  56. 'SET DIRCLR.DATE=-3:on blue'
  57. 'SET DIRCLR.EXT=BAT,EXE,COM,CMD:bright red'
  58. 'SET DIRCLR.WPABSTRACT=green'
  59. 'SET CMDSHL.PROMPT=cmdshl $p$g'
  60. 'SET HELP.REF=cmdpak0+mlrxshl+cmdpak'
  61. 'SET HELP.CMDSHL=cmdpak0+mlrxshl+cmdpak'
  62. 'SET HELP.COMMAND=xhelp'
  63. 'SET HELP.SWITCHES=/? -h --help'
  64. helpSwitches = '/? -h --help'
  65. 'SET HELP.ANCHOR=on blue'
  66. 'SET HELP.BOLD=bright'
  67. 'SET HELP.ITALICS=cyan'
  68. 'SET HELP.COUNTRY=001'
  69. 'ALIAS dir=xdir %*'
  70. 'ALIAS ren=xren %*'
  71. 'ALIAS copy=xcp %*'
  72. 'ALIAS help='SysSearchPath('PATH', 'xhelp.cmd')' %*'
  73. 'ALIAS ls=xdir %*'
  74. 'ALIAS mv=xren %*'
  75. 'ALIAS cp=xcp %*'
  76. 'ALIAS ?=xhelp %*'
  77. impCD = 2
  78. "ALIAS e0=RX call eval('e' SysSearchPath('DPATH', 'profile.shl'))"
  79. "ALIAS e1=RX call eval('e' SysBootDrive()||'\config.sys')"
  80. "ALIAS e2=RX call eval('e' SysBootDrive()||'\autoexec.bat')"
  81. 'ALIAS e3=e "H:\develop\distribute\cmdshl\ToDo list.shl"'
  82. 'help -w'
  83.  
  84.