1 /* -*- buffer-read-only: t -*- vi: set ro:
2    THIS FILE IS GENERATED AUTOMATICALLY.  PLEASE DO NOT EDIT.
3 */
4 #line 1 "eclatcl.m4"
5 /* This file is part of Eclat.
6    Copyright (C) 2012-2018 Sergey Poznyakoff.
7 
8    Eclat is free software; you can redistribute it and/or modify
9    it under the terms of the GNU General Public License as published by
10    the Free Software Foundation; either version 3, or (at your option)
11    any later version.
12 
13    Eclat is distributed in the hope that it will be useful,
14    but WITHOUT ANY WARRANTY; without even the implied warranty of
15    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16    GNU General Public License for more details.
17 
18    You should have received a copy of the GNU General Public License
19    along with Eclat.  If not, see <http://www.gnu.org/licenses/>. */
20 
21 #line 23
22 
23 
24 
25 
26 #line 35
27 
28 
29 #line 1 "mksubnet-cl.opt"
30 /* This file is part of Eclat.
31    Copyright (C) 2012-2018 Sergey Poznyakoff.
32 
33    Eclat is free software; you can redistribute it and/or modify
34    it under the terms of the GNU General Public License as published by
35    the Free Software Foundation; either version 3, or (at your option)
36    any later version.
37 
38    Eclat is distributed in the hope that it will be useful,
39    but WITHOUT ANY WARRANTY; without even the implied warranty of
40    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
41    GNU General Public License for more details.
42 
43    You should have received a copy of the GNU General Public License
44    along with Eclat.  If not, see <http://www.gnu.org/licenses/>. */
45 
46 char const *zone;
47 
48 
49 #line 29 "mksubnet-cl.opt"
50 
51 #line 29
52 
53 #line 29
54 #ifdef HAVE_CONFIG_H
55 #line 29
56 # include <config.h>
57 #line 29
58 #endif
59 #line 29
60 #ifdef HAVE_GETOPT_H
61 #line 29
62 # include <getopt.h>
63 #line 29
64 #endif
65 #line 29
66 #include <unistd.h>
67 #line 29
68 
69 #line 29
70 #include <grecs.h>
71 #line 29
72 #include <grecs/opt.h>
73 #line 29
74 /* Option codes */
75 #line 29
76 enum {
77 #line 29
78 	_OPTION_INIT=255,
79 #line 29
80 	#line 24 "mksubnet-cl.opt"
81 
82 #line 24
83 	OPTION_AVAILABILITY_ZONE,
84 #line 29 "mksubnet-cl.opt"
85 
86 #line 29
87 	OPTION_USAGE,
88 
89 #line 29 "mksubnet-cl.opt"
90 	MAX_OPTION
91 #line 29
92 };
93 #line 29
94 #ifdef HAVE_GETOPT_LONG
95 #line 29
96 static struct option long_options[] = {
97 #line 29
98 	#line 22 "mksubnet-cl.opt"
99 
100 #line 22
101 	{ "zone", required_argument, 0, 'z' },
102 #line 24 "mksubnet-cl.opt"
103 
104 #line 24
105 	{ "availability-zone", required_argument, 0, OPTION_AVAILABILITY_ZONE },
106 #line 29 "mksubnet-cl.opt"
107 
108 #line 29
109 	{ "help", no_argument, 0, 'h' },
110 #line 29 "mksubnet-cl.opt"
111 
112 #line 29
113 	{ "usage", no_argument, 0, OPTION_USAGE },
114 
115 #line 29 "mksubnet-cl.opt"
116 	{0, 0, 0, 0}
117 #line 29
118 };
119 #line 29
120 #endif
121 #line 29
122 static struct grecs_opthelp opthelp[] = {
123 #line 29
124 	#line 25 "mksubnet-cl.opt"
125 
126 #line 25
127 	{
128 #line 25
129 #ifdef HAVE_GETOPT_LONG
130 #line 25
131 	  "-z, --zone, --availability-zone",
132 #line 25
133 #else
134 #line 25
135 	  "-z",
136 #line 25
137 #endif
138 #line 25
139 				   N_("ZONE"), 0, N_("set availablility zone") },
140 #line 29 "mksubnet-cl.opt"
141 
142 #line 29
143 	{ NULL, NULL, 0, N_("Other options") },
144 #line 29 "mksubnet-cl.opt"
145 
146 #line 29
147 	{
148 #line 29
149 #ifdef HAVE_GETOPT_LONG
150 #line 29
151 	  "-h, --help",
152 #line 29
153 #else
154 #line 29
155 	  "-h",
156 #line 29
157 #endif
158 #line 29
159 				   NULL, 0, N_("Give this help list") },
160 #line 29 "mksubnet-cl.opt"
161 
162 #line 29
163 	{
164 #line 29
165 #ifdef HAVE_GETOPT_LONG
166 #line 29
167 	  "--usage",
168 #line 29
169 #else
170 #line 29
171 	  "",
172 #line 29
173 #endif
174 #line 29
175 				   NULL, 0, N_("Give a short usage message") },
176 
177 #line 29 "mksubnet-cl.opt"
178 };
179 #line 19 "mksubnet-cl.opt"
180 
181 #line 19
182 
183 #line 19
184 static struct grecs_proginfo proginfo = {
185 #line 19
186 	"eclat", /* progname */
187 #line 19
188 	NULL, /* subcommands */
189 #line 19
190 	N_("create subnet"), /* docstring */
191 #line 19
192 	N_("CIDR VPC-ID"), /* args_doc */
193 #line 19
194 	opthelp, /* opthelp */
195 #line 19
196 	sizeof(opthelp)/sizeof(opthelp[0]), /* optcount */
197 #line 19
198 	NULL, /* print_help_hook */
199 #line 19
200 	NULL, /* print_version_hook */
201 #line 19
202 	PACKAGE_NAME,    /* package */
203 #line 19
204 	PACKAGE_VERSION, /* version */
205 #line 19
206 	NULL, /* license */
207 #line 19
208 NULL,/* copyright_year */
209 #line 19
210 NULL, /* copyright_holder */
211 #line 19
212 	NULL, /* *authors */
213 #line 19
214 	"<" PACKAGE_BUGREPORT ">", /* bug_address */
215 #line 19
216 	PACKAGE_URL, /* url */
217 #line 19
218 	NULL  /* epilogue */
219 #line 19
220 };
221 #line 19
222 static struct grecs_node *cmdline_tree;
223 #line 19
224 
225 #line 19
226 
227 #line 29 "mksubnet-cl.opt"
228 
229 #line 29
230 
231 
232 
233 #line 31
234 static void
235 #line 31
mksubnet_parse_options(eclat_command_env_t * env,int argc,char * argv[],int * index)236 mksubnet_parse_options(eclat_command_env_t *env, int argc, char *argv[], int *index)
237 #line 31
238 {
239 #line 31
240 	const char *cmds[3] = { env->cmd->name, env->cmd->ident, NULL };
241 #line 31
242 	proginfo.subcmd = (char**) cmds;
243 #line 31
244 
245 #line 31
246 {
247 #line 31
248 
249 #line 31
250  {
251 #line 31
252   int c;
253 #line 31
254 
255 #line 31
256   optind = 0;
257 #line 31
258 #ifdef HAVE_GETOPT_LONG
259 #line 31
260   while ((c = getopt_long(argc, argv, "z:h",
261 #line 31
262 			  long_options, NULL)) != EOF)
263 #line 31
264 #else
265 #line 31
266   while ((c = getopt(argc, argv, "z:h")) != EOF)
267 #line 31
268 #endif
269 #line 31
270     {
271 #line 31
272       switch (c)
273 #line 31
274 	{
275 #line 31
276 	default:
277 #line 31
278 	   exit(EX_USAGE);	   exit(EX_USAGE);
279 #line 31
280 	#line 25 "mksubnet-cl.opt"
281 	 case 'z': case OPTION_AVAILABILITY_ZONE:
282 #line 25
283 	  {
284 #line 25
285 
286 	zone = optarg;
287 
288 #line 27
289 	     break;
290 #line 27
291 	  }
292 #line 29 "mksubnet-cl.opt"
293 	 case 'h':
294 #line 29
295 	  {
296 #line 29
297 
298 #line 29
299 		grecs_print_help(&proginfo);
300 #line 29
301 		exit(0);
302 #line 29
303 
304 #line 29
305 	     break;
306 #line 29
307 	  }
308 #line 29 "mksubnet-cl.opt"
309 	 case OPTION_USAGE:
310 #line 29
311 	  {
312 #line 29
313 
314 #line 29
315 		grecs_print_usage(&proginfo);
316 #line 29
317 		exit(0);
318 #line 29
319 
320 #line 29
321 	     break;
322 #line 29
323 	  }
324 
325 #line 31 "mksubnet-cl.opt"
326 	}
327 #line 31
328     }
329 #line 31
330 
331 #line 31
332   *index = optind;
333 #line 31
334   if (cmdline_tree)
335 #line 31
336     {
337 #line 31
338       struct grecs_node *rn = grecs_node_create(grecs_node_root, NULL);
339 #line 31
340       rn->down = cmdline_tree;
341 #line 31
342       cmdline_tree = rn;
343 #line 31
344     }
345 #line 31
346  }
347 #line 31
348 
349 #line 31
350 }
351 #line 31
352 
353 #line 31
354 }
355 #line 36
356 
357 
358 
359