home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Best Objectech Shareware Selections
/
UNTITLED.iso
/
boss
/
util
/
dos
/
007
/
wced.doc
< prev
next >
Wrap
Text File
|
1993-04-25
|
8KB
|
278 lines
Wced 1.7f Command Line Editor
Copyright (C) 1990, 1991, 1992, 1993 Stuart Russell (WormSoft)
Wced is a command line editor. Features include a history of
commands typed, aliasing of commands (with parameters), filename
completion and command line editing. The main aim of Wced is to
improve the command line editing of DOS but use as little memory as
possible. When installed, wced uses approximately 14k of
conventional memory.
Usage
wced [-acdlpqst] [filespec]
Options
a - Filenames are listed in alphabetical order.
c - Makes the history list circular. Normally command completion
stops at either end of the history list.
d - Directories in lists have a trailing '\'.
l - All filenames are listed in lowercase.
p - List files on PATH matching given filespec. Wced will
NOT become resident.
q - The bell is not sounded when the start or end of the
history list is reached.
s - Filenames matching the following filespec are listed.
The default filespec is *.*. Wced will NOT become
resident.
t - Translate the wced command buffer to make it DOS compatible.
ie. '.\string.\string.\' -> 'string\string'
'\string\string\' -> '\string\string'
'\' -> '\'
1. Reading Initial Commands and Aliases
If not invoked with the 's' or 'p' flag and a filename exists on
the command line Wced will attempt to read initial commands and/or
aliases from the file. The alias definition has the following
format:
wced alias fullstring
For example, 'wced d dir' aliases 'd' to 'dir'. Subsequently, if
'd' is the first word on the command line then it is substituted
with 'dir'.
Any line not beginning with 'wced' is treated as a command and is
placed into the history list.
2. Alias Parameters
The aliases can have parameters in their definitions. For
example,
wced ld hotdir %1 /d/2
aliases 'ld' to 'hotdir %1 /d/2'. The %1 will be replaced with the
first argument given on the command line, ie.
C:>ld list.*
will result in DOS executing
hotdir list.* /d/2
Another example shows how all arguments can be used.
wced del del %* /p
This aliases 'del' to 'del %* /p'. The %* will be replaced by all
arguments on the command line, ie.
del tom dick harry
will result in DOS executing
del tom dick harry /p
In DOS >= 4.0 this will prompt before deleting the file(s).
The parameters can also be used in definitions entered from the
command line (as described below).
3. The Editing and History functions
The default editing and history keys are :
Left Arrow Move cursor left one place along command line
Right Arrow Move cursor right one place along command line
Ctrl-Left Move cursor left to end of word
Ctrl-Right Move cursor right to end of word
Home Move to beginning of command line
End Move to end of command line
Up Arrow Move backwards (older) through history
Down Arrow Move forwards (newer) through history
Alt-d Delete entire command line
Del Delete character under cursor on command line
BS Delete character before cursor on command line
Alt-x Quit and uninstall Wced
Alt-r Remove entry on command line from history
Alt-v Print version
Alt-b Delete to beginning of command line
Alt-e Delete to end of command line
Ctrl-c Store but do not execute command on command line
Wced only operates in insert mode - there is no overtype mode.
The history commands will attempt to complete the command on the
command line. An example is shown below.
Assume the history contains
ls
cd backup
less nogood
larn
worm <--- Most recent
If the user now does
C:>l_<UPARROW>
then the command line will be completed as
C:>larn_
with the cursor on the end of the line.
If the <UPARROW> is pressed again the command line becomes
C:>less nogood_
and again ...
C:>ls_
The cursor is always placed at the end of the line. The feedback
I have received suggests that people prefer this. If Wced can not
complete the command it will sound the bell unless the 'q' flag
has been specified.
4. The Alias functions
The alias functions of wced are accessed using Alt-a. The action
taken depends on the contents of the command line. If the command
line is empty then a list of current aliases is printed. If the
command line contains only one word then this is assumed to be an
alias that is to be removed from the alias table. If the alias
can not be matched then an error message is printed. If the
command line contains more than one word then the alias is added
to the alias table replacing a previous alias if necessary. Some
examples follow.
Adding:
C:>l ls<ALT-a>
C:>pkv pkunzip -vb<ALT-a>
This adds the aliases l and pkv to the alias table.
Listing:
C:><ALT-a>
l = ls
pkv = pkunzip -vb
This prints the current aliases.
Deleting:
C:>l<ALT-a>
This deletes an entry from the alias table.
C:><ALT-a>
pkv = pkunzip -vb
5. Filename Completion/Show
The filename completion/show functions are assigned to :
Alt-c Complete filename
Alt-s Show possible filename completions
Tab Attempt to complete filename/show possible
completions
Ctrl-Tab Complete/Show matching files on PATH
Filenames will be completed as far as possible. When the
completion becomes ambiguous the possible matching files
will be displayed.
For example consider the following files.
backup\ buffer.c buffer.h buffer.obj
list.c list.h list.obj
wced.exe wced.doc wced17.zip
Pressing <Tab> on an empty line will produce a listing of the
entire directory contents.
C:><Tab>
backup\ list.c wced.doc
buffer.c list.h wced.exe
buffer.h list.obj wced17.zip
buffer.obj
The filename completion only completes the filename that the
cursor is at the end of. In the next example files beginning with
'b' are searched for and the 'less ' is ignored.
The filename can not be completed further so the possiblities are
listed.
C:>less b<Tab>
backup\ buffer.c buffer.h buffer.obj
The command line is unaltered and ready for more of the filename
to be given.
C:>less b_
C:>less bu<Tab>
Now the 'u' has been given the filename can be completed further.
C:>less buffer._
The filename again can not be completed further so the
possibilities are listed.
C:>less buffer.<Tab>
buffer.c buffer.h buffer.obj
C:>less buffer._
The user adds the required extension in this case.
C:>less buffer.h
Acknowledgements
Any comments, problems or suggestions for additions should be
sent to
sjr@uk.ac.warwick.dcs
Many, many thanks to all those people who took the trouble to
comment and suggest improvements for Wced. Special thanks to Matthijs.
Wkeys (v2.0) key programmer for Wced.
The Wced program is accompanied by a program called Wkeys. This
allows the editor and history keys to be reprogrammed to suite
the user. Wkeys allows the use of the extended keys, ie F11, on
an extended keyboard. The keys are defined in a data file. An
example containing the default bindings is supplied.
Usage:
wkeys [ datafile [ exefile ] ]
If an error occurs the exe file will not be updated. Hopefully a
helpfull error message will be printed to highlight the problem
in the input.
If no input files are supplied then 'wkeys.dat' and 'wced.exe'
are assumed.