xref: /csrg-svn/sys/tahoe/stand/vdformat/help.c (revision 29531)
1*29531Ssam #ifndef lint
2*29531Ssam static char sccsid[] = "@(#)help.c	1.1 (Berkeley/CCI) 07/05/86";
3*29531Ssam #endif
4*29531Ssam 
5*29531Ssam #include	"vdfmt.h"
6*29531Ssam #include	"cmd.h"
7*29531Ssam 
8*29531Ssam /*
9*29531Ssam **	These routines are used to display all the system help messages
10*29531Ssam ** that the operator requests.  They look through the system command
11*29531Ssam ** tables to print the commands and the help messages in a neat mannor.
12*29531Ssam **
13*29531Ssam **	The only break in this rule is the help processor for digit entry
14*29531Ssam ** Which informs the operator what numeric range is valid.
15*29531Ssam */
16*29531Ssam 
help_text(tbl)17*29531Ssam help_text(tbl)
18*29531Ssam cmd_text_element	*tbl;
19*29531Ssam {
20*29531Ssam 	indent();
21*29531Ssam 	print_common_help();
22*29531Ssam 	indent();
23*29531Ssam 	while(tbl->cmd_token != 0) {
24*29531Ssam 		register int	count;
25*29531Ssam 
26*29531Ssam 		count = 9 - strlen(tbl->cmd_text);
27*29531Ssam 		print("%s", tbl->cmd_text);
28*29531Ssam 		while(count--)
29*29531Ssam 			putchar(' ');
30*29531Ssam 		printf("- %s.\n", tbl->cmd_help);
31*29531Ssam 		tbl++;
32*29531Ssam 	}
33*29531Ssam 	exdent(2);
34*29531Ssam 	print("\n");
35*29531Ssam }
36*29531Ssam 
37*29531Ssam 
38*29531Ssam /*
39*29531Ssam **
40*29531Ssam */
41*29531Ssam 
print_common_help()42*29531Ssam print_common_help()
43*29531Ssam {
44*29531Ssam 	print("The following commands are available:\n");
45*29531Ssam 	indent();
46*29531Ssam 	print("%s - %s.\n", "KILL    ", "Abort all operations");
47*29531Ssam 	print("%s - %s.\n", "STATus  ", "Display formatter state");
48*29531Ssam 	exdent(1);
49*29531Ssam }
50