aboutsummaryrefslogtreecommitdiff
path: root/src/cmdline.opt
diff options
context:
space:
mode:
Diffstat (limited to 'src/cmdline.opt')
-rw-r--r--src/cmdline.opt193
1 files changed, 193 insertions, 0 deletions
diff --git a/src/cmdline.opt b/src/cmdline.opt
new file mode 100644
index 0000000..31fcf20
--- /dev/null
+++ b/src/cmdline.opt
@@ -0,0 +1,193 @@
1/* This file is part of GNU Pies. -*- c -*-
2 Copyright (C) 2008, 2009, 2010, 2011 Sergey Poznyakoff
3
4 GNU Pies is free software; you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation; either version 3, or (at your option)
7 any later version.
8
9 GNU Pies is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
13
14 You should have received a copy of the GNU General Public License
15 along with GNU Pies. If not, see <http://www.gnu.org/licenses/>. */
16
17OPTIONS_BEGIN("pies",
18 [<process invocation and execution supervisor>],
19 [<>],
20 [<gnu>],
21 [<copyright_year=2011>],
22 [<copyright_holder=Sergey Poznyakoff>])
23
24GROUP(Operation Mode)
25
26OPTION(config-file,c,FILE,
27 [<use FILE instead of the default configuration>])
28BEGIN
29 add_config (current_syntax, optarg);
30END
31
32OPTION(config-help,,,
33 [<show configuration file summary>])
34BEGIN
35 config_help ();
36 exit (0);
37END
38
39OPTION(,E,,
40 [<preprocess config and exit>])
41BEGIN
42 preprocess_only = 1;
43END
44
45OPTION(force,,,
46 [<force startup even if another instance may be running>])
47BEGIN
48 force_option = 1;
49END
50
51OPTION(foreground,,,
52 [<remain in foreground>])
53BEGIN
54 log_to_stderr_only = 1;
55 foreground = 1;
56END
57
58OPTION(inetd,i,,
59 [<run in inetd mode>])
60BEGIN
61 if (!instance)
62 instance = "inetd";
63 current_syntax = CONF_INETD;
64 inetd_mode = 1;
65END
66
67OPTION(instance,,NAME,
68 [<set instance name>])
69BEGIN
70 instance = optarg;
71END
72
73OPTION(rate,,NUMBER,
74 [<set default maximum rate for inetd-style components>])
75BEGIN
76 char *p;
77 default_max_rate = strtoul (optarg, &p, 10);
78 if (*p)
79 {
80 logmsg (LOG_ERR, _("not a number: %s"), optarg);
81 exit (EX_USAGE);
82 }
83END
84
85OPTION(stderr,,,
86 [<log to stderr>])
87BEGIN
88 log_to_stderr_only = 1;
89END
90
91OPTION(syntax,,[<{pies|inetd|meta1}>],
92 [<expect configuration files in the given syntax>])
93BEGIN
94 if (str_to_config_syntax (optarg, &current_syntax))
95 {
96 logmsg (LOG_ERR, _("unknown syntax type: %s"), optarg);
97 exit (EX_USAGE);
98 }
99END
100
101OPTION(syslog,,,
102 [<log to syslog>])
103BEGIN
104 log_to_stderr_only = 0;
105END
106
107OPTION(lint,t,,
108 [<parse configuration file and exit>])
109BEGIN
110 log_to_stderr_only = 1;
111 lint_mode = 1;
112END
113
114GROUP(Preprocessor)
115
116OPTION(define,D,[<NAME[=VALUE]>],
117 [<define a preprocessor symbol NAME as having VALUE or empty>])
118BEGIN
119 add_pp_option ("-D", optarg);
120END
121
122OPTION(undefine,U,NAME,
123 [<undefine a preprocessor symbol NAME>])
124BEGIN
125 add_pp_option ("-U", optarg);
126END
127
128GROUP(Component Management)
129
130OPTION(reload,r,,
131 [<reload the running instance of pies>])
132ALIAS(hup)
133BEGIN
134 log_to_stderr_only = 1;
135 command = COM_RELOAD;
136END
137
138OPTION(restart-component,R,,
139 [<restart components named in the command line>])
140BEGIN
141 log_to_stderr_only = 1;
142 command = COM_RESTART;
143END
144
145OPTION(status,s,,
146 [<display info about the running instance>])
147BEGIN
148 log_to_stderr_only = 1;
149 command = COM_STATUS;
150END
151
152OPTION(stop,S,,
153 [<stop the running instance>])
154BEGIN
155 log_to_stderr_only = 1;
156 command = COM_STOP;
157END
158
159GROUP(Debugging and Additional Diagnostics)
160
161OPTION(dump-depmap,,,
162 [<dump dependency map>])
163BEGIN
164 log_to_stderr_only = 1;
165 command = COM_DUMP_DEPMAP;
166END
167
168OPTION(dump-prereq,,,
169 [<dump prerequisite charts>])
170BEGIN
171 log_to_stderr_only = 1;
172 command = COM_DUMP_PREREQ;
173END
174
175OPTION(source-info,,,
176 [<show source info with debugging messages>])
177BEGIN
178 source_info_option = 1;
179END
180
181OPTION(debug,x,LEVEL,
182 [<set debug verbosity level>])
183BEGIN
184 debug_level = strtoul (optarg, NULL, 0);
185END
186
187OPTIONS_END
188
189void
190parse_options(int argc, char *argv[], int *index)
191{
192 GETOPT(argc, argv, *index)
193}

Return to:

Send suggestions and report system problems to the System administrator.