home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 30 fixes_v / 30-fixes_v.zip / f16_b.zip / CEDT.B < prev    next >
Text File  |  1994-01-11  |  11KB  |  258 lines

  1. DESCRIPTION
  2.  
  3. CMDEDIT (OS2EDIT) is a program that allows editing and retrieval of the
  4. command line, allows commands to be assigned to functions keys, and allows
  5. aliases for commands to be created
  6.  
  7. COMMAND LINE
  8.  
  9.         CMDEDIT [options] [aliasfile [cmdfile]] (DOS)
  10.         CMDEDIT -q [cmdfile]                    (DOS)
  11.         OS2EDIT                                 (OS/2 1.x)
  12.         OS22EDIT                                (OS/2 2.x)
  13.  
  14.         Options:
  15.  
  16.           -i    Go to insert mode at the start of each command.
  17.           -s    Make insert mode 'sticky' between commands. (overrides -i)
  18.           -e    Always save commands at the end of the buffer.
  19.                 Normally, duplicate commands are not stored in the buffer.
  20.           -a    Use the aliases regardless of the process requesting the string.
  21.                 Normally it tries to determine if COMMAND.COM is the requesting
  22.                 process, but the check does not work properly on some systems,
  23.                 or if a subsequent command processor has been invoked.
  24.           -f    Stop completing a file name when multiple choices exist. See
  25.                 descriptions of Tab and Shift-Tab keys for details.
  26.       -l    Complete file names in lower case
  27.           -mx   Character x will be used to separate multiple commands
  28.       -h    Directory commands (u,d,o,r) must be preceded with '#'
  29.       -\    Append '\' after directories, and ' ' after normal files
  30.           during filename completion
  31.  
  32.         Notes:
  33.  
  34.         - If the environment variable CMDEDIT (or OS2EDIT) is set, and
  35.           no command is given to CMDEDIT (OS2EDIT) the environment variable
  36.           will be used as the command line.
  37.  
  38.         - [cmdfile] may be used to save the command buffer if CMDEDIT is
  39.           unloaded then reloaded. For example:
  40.  
  41.               cmdedit -q cmd.fil
  42.               cmdedit alias.fil cmd.fil
  43.  
  44.           will use cmd.fil to save/restore the internal command buffer.
  45.           
  46.         Notes for OS/2 1.x:
  47.  
  48.         - OS2EDIT.DLL is also loaded and needs to be in a LIBPATH directory
  49.           (where you keep your other .DLL files)
  50.  
  51.         - You must remove the SET KEYS=ON statment from CONFIG.SYS
  52.       or change it to SET KEYS=OFF.
  53.  
  54.         - You may not pass the command line directly to OS2EDIT. You must
  55.           use the environment variable method to pass the command line.
  56.  
  57.     Notes for OS/2 2.x.
  58.  
  59.     - OS22EDIT is not run directly. Instead, change CONFIG.SYS as follows
  60.  
  61.         SET OS2_SHELL=[drive][path]CMD.EXE ...
  62.       becomes
  63.         SET OS2_SHELL=[drive][path]OS22EDIT.EXE [drive][path]CMD.EXE ...
  64.  
  65.       In this case, you must set the OS2EDIT environment variable
  66.       in CONFIG.SYS, in order for it to be noticed by OS22EDIT.
  67.     
  68.     - Only environment variables set in CONFIG.SYS are available to
  69.       OS22EDIT.
  70.  
  71.         - You may not pass the command line directly to OS22EDIT. You must
  72.           use the environment variable method to pass the command line.
  73.       This environment variable must be set in CONFIG.SYS.
  74.  
  75.  
  76.     - OS2EDIT.DLL is not needed
  77.  
  78. The default alias file name is
  79.  
  80.         none                                (DOS)
  81.         C:\ALIAS.OS2                        (OS/2)
  82.  
  83.  
  84. FORM OF THE ALIAS FILE
  85.  
  86. The alias file contains records of the following form
  87.  
  88. word  string             - When <word> appears as the first word on the
  89.                            command line, it will be substituted with
  90.                            <string> before being passed to DOS.
  91.  
  92. <Fn> string              - When <Fn> is hit, CMDEDIT behaves as if <string> were
  93.                            typed by you. It is inserted if you are in insert
  94.                            mode, overstrikes if not, etc..
  95.                            keys F1 thru F40 are supported.
  96.  
  97. <Fn> !string             - As above, but an <ENTER> is generated
  98.                            following string.
  99.  
  100. Only keys F1 through F10 on the keyboard are actually used.  For F11 thru
  101. F20, use the shift key, for F21 to F30 use Ctrl key and for F31 to F40 use
  102. the Alt key.
  103.  
  104. Within the replacement string, the symbols %1 %2 ...  %9 are replaceable by
  105. parameters.  When the alias is invoked, each blank delimited word following
  106. the alias word is considered to be a parameter to the alias.  Parameters
  107. which have no corresponding %n in the alias are appended to the end of the
  108. command.  For example, if
  109.  
  110.         printps myfile lpt1
  111.  
  112. is typed, and the alias
  113.  
  114.         printps copy preamble.ps+%1.c+eoj.ps
  115.  
  116. is present in the alias list, the resulting DOS command would be
  117.  
  118.         copy preamble.ps+myfile.c+eoj.ps lpt1
  119.  
  120. A symbol such as %name% within an alias will be replaced with the corresponding
  121. DOS or OS/2 environment variable name. For example, the alias
  122.  
  123.         addpath      set path=%path%;%1
  124.  
  125. will cause another directory to be added to your path when used.
  126.  
  127. Aliases are substituted recursively. For example, if the aliases
  128.  
  129.         rn   rename %1 %2
  130.         bk   rn %1.c %1.bak
  131.  
  132. are present, typing
  133.  
  134.         bk foo
  135.  
  136. is equivalent to typing
  137.  
  138.         rename foo.c foo.bak
  139.  
  140. Recursive definitions are handled as well. The alias
  141.  
  142.         dir     dir *.c
  143.  
  144. is perfectly alright, although somewhat limited in its usefulness.
  145. EDITING FEATURES
  146.  
  147. Whenever a command is executed, CMDEDIT will save the command in a buffer for
  148. future recall and editing.  When the buffer becomes full, the oldest command is
  149. discarded.  CMDEDIT will not save a second copy of a command that is already
  150. present in the buffer.
  151.  
  152. Multiple commands
  153.  
  154. !   (or as set by -m)         Separates multiple commands on a line.
  155.                               A real exclamation point must be entered as !!.
  156.  
  157. Command Retrieval
  158.  
  159. Key               Alternate   Meaning
  160.  
  161. Cursor-Up                     retrieve previous command from the buffer
  162. Cursor-Down                   retrieve next command from the buffer
  163. Ctrl-Cursor-Up    Alt-E       retrieve first command from buffer
  164. Ctrl-Cursor-Down  Alt-B       retrieve last command from buffer
  165. Ctrl-Delete       Alt-X       delete the current command from the buffer
  166. Page-Down                     save the unentered command line in the buffer
  167. Alt-C                         list all commands in the buffer
  168. Alt-A                         list all current aliases
  169. Ctrl-Tab          Alt-N       retrieve next command that begins as ... see below
  170. Alt-Tab           Alt-P       retrieve previous command that begins as ...
  171. Ctrl-Insert       Alt-Z       retrieve accidentally erased line
  172.  
  173. The Alt-Tab and Ctrl-Tab commands are used by typing the beginning of a command
  174. which is in the buffer then pressing the key.  The entire command will then
  175. appear on the command line.  You can press Alt-Tab again to see other commands
  176. starting with that prefix.
  177.  
  178. Cursor movement
  179.  
  180. Cursor-Left                   move left on command line
  181. Cursor-Right                  move right on command line
  182. Home                          move to beginning of line
  183. End                           move to end of line
  184. Ctrl-Cursor-Left              move left word
  185. Ctrl-Cursor-Right             move right word
  186.  
  187. Line editing
  188.  
  189. Insert                        toggle in and out of insert mode
  190. Delete                        delete character under cursor
  191. Ctrl-Delete                   delete to end of word
  192. Backspace                     delete character to left of cursor
  193. Ctrl-Backspace                delete to beginning of word
  194. Escape                        delete input line and leave insert mode
  195. Ctrl-Home                     erase to beginning of line
  196. Ctrl-End                      erase to end of line
  197. Alt-H                      toggle the -h option interactively
  198.  
  199. Retrieving screen items
  200.  
  201. Alt-Cursor-Up     Alt-U       move a cursor up the screen
  202. Alt-Cursor-Down   Alt-D       move a cursor down the screen
  203. Alt-Cursor-Left   Alt-L       move a cursor left on the screen
  204. Alt-Cursor-Right  Alt-R       move a cursor right on the screen
  205. Alt-Home          Alt-0       move screen cursor to column 0
  206. Alt-End           Alt-2       retrieve two lines from screen
  207.  
  208. This is useful for changing your path.  Type path, then retrieve it from
  209. the screen, edit it into a command and press Enter.  You can also type a
  210. batch file, then execute certain commands from it using this capability.
  211.  
  212. File name completion
  213.  
  214. Tab                           Complete file name
  215. Shift-Tab                  /  List choices if -f option in effect.
  216.                            \  List previous file name if -f not in effect.
  217.  
  218. These keys are used by typing the first part of a filename and then
  219. pressing Tab.  For example, typing edit my<TAB> will expand to edit
  220. MYFILE.C if the file MYFILE.C is the first file starting with 'MY' in the
  221. current directory.  If Tab is pressed before the first space on the line,
  222. the path is searched for a matching command.  For example, typeing
  223. cmde<TAB> might expand to c:\lang\bin\CMDEDIT.EXE.  Subsequent TABS
  224. will list the next file matching the pattern.  Shift-Tab will back up one
  225. file name.  With -f in effect, the file name is only completed to a point
  226. where a choice must be made, and Shift-Tab will list those choices.  More
  227. characters may then by typed to differentiate between the choices and Tab
  228. hit again.  Also the environment variable CMDMATCH controls which file
  229. extensions are to be matched.  For example, set CMDMATCH=.C.H.ASM means
  230. only match files of type .C, .H and .ASM.  set CMDMATCH=~.OBJ.EXE means
  231. match all files except those of type
  232. .OBJ and .EXE.
  233.  
  234. DIRECTORY COMMANDS
  235.  
  236. I hate typing the '\' character.  It's in an awkward spot on the keyboard.
  237. This fact prompted me to put some support into CMDEDIT to change the
  238. current working directory without typing '\'.  I also like to change my
  239. current working directory and drive as an atomic operation.  In the
  240. directory commands, the following substitutions are made in a path.
  241.  
  242.     /   becomes \
  243.     ' ' becomes \
  244.     -   becomes ..\
  245.  
  246. For example, "--codegen 8086 c" and "--codegen/8086/c" both become
  247. "..\..\codegen\8086\c".
  248.  
  249. Commands
  250.  
  251.         d [d:]path             Set current drive to d and directory to path
  252.         o [d:]path             The "over" command. Equivalent to #d [d:]..\path
  253.         u [n]                  Go up n levels in the tree
  254.         r                      Return to the previous drive and directory
  255.  
  256. You can alias these commands as well. I have aliases for 'd', 'o', 'u' and
  257. 'r' in my alias file.
  258.