* Copyright (c) 1983 Regents of the University of California.
* This code is derived from software contributed to Berkeley by
* Edward Wang at The University of California, Berkeley.
* Redistribution and use in source and binary forms are permitted provided
* that: (1) source distributions retain this entire copyright notice and
* comment, and (2) distributions including binaries display the following
* acknowledgement: ``This product includes software developed by the
* University of California, Berkeley and its contributors'' in the
* documentation or other materials provided with the distribution and in
* all advertising materials mentioning features or use of this software.
* Neither the name of the University nor the names of its contributors may
* be used to endorse or promote products derived from this software without
* specific prior written permission.
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
static char sccsid
[] = "@(#)cmd2.c 3.40 (Berkeley) 6/6/90";
char *help_shortcmd
[] = {
"# Select window # and return to conversation mode",
"%# Select window # but stay in command mode",
"escape Return to conversation mode without changing window",
"^^ Return to conversation mode and change to previous window",
"M# Move window # to its previous position",
"s# Change the size of window #",
"S# Change window # to its previous size",
"^E Scroll down one line",
"^U Scroll up half a window",
"^D Scroll down half a window",
"^B Scroll up a full window",
"^F Scroll down a full window",
"^S Stop output in current window",
"^Q Restart output in current window",
": Enter a long command",
":alias name string ... Make `name' an alias for `string ...'",
":alias Show all aliases",
":close # ... Close windows",
":close all Close all windows",
":cursor modes Set the cursor modes",
":echo # string ... Print `string ...' in window #",
":escape c Set escape character to `c'",
":foreground # flag Make # a foreground window, if `flag' is true",
":label # string Set label of window # to `string'",
":list List all open windows",
":default_nline lines Set default window buffer size to `lines'",
":default_shell string ...",
" Set default shell to `string ...'",
":default_smooth flag Set default smooth scroll flag",
":select # Select window #",
":smooth # flag Set window # to smooth scroll mode",
":source filename Execute commands in `filename'",
":terse flag Set terse mode",
":unalias name Undefine `name' as an alias",
":unset variable Deallocate `variable'",
":variable List all variables",
":window [row col nrow ncol nline label pty frame mapnl keepopen smooth shell]",
" Open a window at `row', `col' of size `nrow', `ncol',",
" with `nline' lines in the buffer, and `label'",
":write # string ... Write `string ...' to window # as input",
if ((w
= openiwin(wwnrow
- 3, "Help")) == 0) {
error("Can't open help window: %s.", wwerror());
wwprintf(w
, "The escape character is %c.\n", escapec
);
wwprintf(w
, "(# represents one of the digits from 1 to 9.)\n\n");
if (help_print(w
, "Short commands", help_shortcmd
) >= 0)
(void) help_print(w
, "Long commands", help_longcmd
);
help_print(w
, name
, list
)
wwprintf(w
, "%s:\n\n", name
);
wwprintf(w
, "%s: (continued)\n\n", name
);
return more(w
, 1) == 2 ? -1 : 0;
wwputs("Really quit [yn]? ", cmdwin
);
setterse(!quit
&& oldterse
);