xref: /freebsd/usr.sbin/lpr/lpc/cmdtab.c (revision 4a1a0dbedbb3fa74041adb9862f4608cd990a3c5)
1dea673e9SRodney W. Grimes /*
2dea673e9SRodney W. Grimes  * Copyright (c) 1983, 1993
3dea673e9SRodney W. Grimes  *	The Regents of the University of California.  All rights reserved.
4dea673e9SRodney W. Grimes  *
5dea673e9SRodney W. Grimes  * Redistribution and use in source and binary forms, with or without
6dea673e9SRodney W. Grimes  * modification, are permitted provided that the following conditions
7dea673e9SRodney W. Grimes  * are met:
8dea673e9SRodney W. Grimes  * 1. Redistributions of source code must retain the above copyright
9dea673e9SRodney W. Grimes  *    notice, this list of conditions and the following disclaimer.
10dea673e9SRodney W. Grimes  * 2. Redistributions in binary form must reproduce the above copyright
11dea673e9SRodney W. Grimes  *    notice, this list of conditions and the following disclaimer in the
12dea673e9SRodney W. Grimes  *    documentation and/or other materials provided with the distribution.
13dea673e9SRodney W. Grimes  * 3. All advertising materials mentioning features or use of this software
14dea673e9SRodney W. Grimes  *    must display the following acknowledgement:
15dea673e9SRodney W. Grimes  *	This product includes software developed by the University of
16dea673e9SRodney W. Grimes  *	California, Berkeley and its contributors.
17dea673e9SRodney W. Grimes  * 4. Neither the name of the University nor the names of its contributors
18dea673e9SRodney W. Grimes  *    may be used to endorse or promote products derived from this software
19dea673e9SRodney W. Grimes  *    without specific prior written permission.
20dea673e9SRodney W. Grimes  *
21dea673e9SRodney W. Grimes  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
22dea673e9SRodney W. Grimes  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
23dea673e9SRodney W. Grimes  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
24dea673e9SRodney W. Grimes  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
25dea673e9SRodney W. Grimes  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
26dea673e9SRodney W. Grimes  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
27dea673e9SRodney W. Grimes  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
28dea673e9SRodney W. Grimes  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
29dea673e9SRodney W. Grimes  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
30dea673e9SRodney W. Grimes  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
31dea673e9SRodney W. Grimes  * SUCH DAMAGE.
32dea673e9SRodney W. Grimes  */
33dea673e9SRodney W. Grimes 
34dea673e9SRodney W. Grimes #ifndef lint
354a1a0dbeSGarrett Wollman /*
36dea673e9SRodney W. Grimes static char sccsid[] = "@(#)cmdtab.c	8.1 (Berkeley) 6/6/93";
374a1a0dbeSGarrett Wollman */
384a1a0dbeSGarrett Wollman static const char rcsid[] =
394a1a0dbeSGarrett Wollman 	"$Id$";
40dea673e9SRodney W. Grimes #endif /* not lint */
41dea673e9SRodney W. Grimes 
42dea673e9SRodney W. Grimes #include <sys/cdefs.h>
43dea673e9SRodney W. Grimes 
44dea673e9SRodney W. Grimes #include "lpc.h"
45dea673e9SRodney W. Grimes #include "extern.h"
46dea673e9SRodney W. Grimes 
47dea673e9SRodney W. Grimes /*
48dea673e9SRodney W. Grimes  * lpc -- command tables
49dea673e9SRodney W. Grimes  */
50dea673e9SRodney W. Grimes char	aborthelp[] =	"terminate a spooling daemon immediately and disable printing";
51dea673e9SRodney W. Grimes char	cleanhelp[] =	"remove cruft files from a queue";
52dea673e9SRodney W. Grimes char	enablehelp[] =	"turn a spooling queue on";
53dea673e9SRodney W. Grimes char	disablehelp[] =	"turn a spooling queue off";
54dea673e9SRodney W. Grimes char	downhelp[] =	"do a 'stop' followed by 'disable' and put a message in status";
55dea673e9SRodney W. Grimes char	helphelp[] =	"get help on commands";
56dea673e9SRodney W. Grimes char	quithelp[] =	"exit lpc";
57dea673e9SRodney W. Grimes char	restarthelp[] =	"kill (if possible) and restart a spooling daemon";
58dea673e9SRodney W. Grimes char	starthelp[] =	"enable printing and start a spooling daemon";
59dea673e9SRodney W. Grimes char	statushelp[] =	"show status of daemon and queue";
60dea673e9SRodney W. Grimes char	stophelp[] =	"stop a spooling daemon after current job completes and disable printing";
61dea673e9SRodney W. Grimes char	topqhelp[] =	"put job at top of printer queue";
62dea673e9SRodney W. Grimes char	uphelp[] =	"enable everything and restart spooling daemon";
63dea673e9SRodney W. Grimes 
64dea673e9SRodney W. Grimes struct cmd cmdtab[] = {
654a1a0dbeSGarrett Wollman 	{ "abort",	aborthelp,	0,		1,	doabort },
664a1a0dbeSGarrett Wollman 	{ "clean",	cleanhelp,	0,		1,	clean },
674a1a0dbeSGarrett Wollman 	{ "enable",	enablehelp,	0,		1,	enable },
68dea673e9SRodney W. Grimes 	{ "exit",	quithelp,	quit,		0 },
694a1a0dbeSGarrett Wollman 	{ "disable",	disablehelp,	0,		1,	disable },
70dea673e9SRodney W. Grimes 	{ "down",	downhelp,	down,		1 },
71dea673e9SRodney W. Grimes 	{ "help",	helphelp,	help,		0 },
72dea673e9SRodney W. Grimes 	{ "quit",	quithelp,	quit,		0 },
734a1a0dbeSGarrett Wollman 	{ "restart",	restarthelp,	0,		0,	restart },
744a1a0dbeSGarrett Wollman 	{ "start",	starthelp,	0,		1,	startcmd },
754a1a0dbeSGarrett Wollman 	{ "status",	statushelp,	0,		0,	status },
764a1a0dbeSGarrett Wollman 	{ "stop",	stophelp,	0,		1,	stop },
77dea673e9SRodney W. Grimes 	{ "topq",	topqhelp,	topq,		1 },
784a1a0dbeSGarrett Wollman 	{ "up",		uphelp,		0,		1,	up },
79dea673e9SRodney W. Grimes 	{ "?",		helphelp,	help,		0 },
80dea673e9SRodney W. Grimes 	{ 0 },
81dea673e9SRodney W. Grimes };
82dea673e9SRodney W. Grimes 
83dea673e9SRodney W. Grimes int	NCMDS = sizeof (cmdtab) / sizeof (cmdtab[0]);
84