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