summaryrefslogtreecommitdiffabout
authorSergey Poznyakoff <gray@gnu.org.ua>2013-04-25 15:24:50 (GMT)
committer Sergey Poznyakoff <gray@gnu.org.ua>2013-04-25 15:24:50 (GMT)
commite545233cb313c7a217c0839390a996744f92edf5 (patch) (unidiff)
treed6c731e8bb23dd8549dd1e512997dd59bd8380bb
parent6788b695b4fa8882fc20ccee6312977e0d8e8a81 (diff)
downloadeclat-e545233cb313c7a217c0839390a996744f92edf5.tar.gz
eclat-e545233cb313c7a217c0839390a996744f92edf5.tar.bz2
Provide additional m4 magic for creating cl interfaces.
* src/Makefile.am (EXTRA_DIST): Add eclatcl.m4 * src/eclatcl.m4: New file. * src/detvol-cl.opt: Rename to src/devol-cl.opt * src/cmdline.opt: Fix a typo * src/allocaddr-cl.opt: Rewrite usning new m4 macros. * src/asscaddr-cl.opt: Likewise. * src/cpimg-cl.opt: Likewise. * src/cpsnap-cl.opt: Likewise. * src/disasaddr-cl.opt: Likewise. * src/freeaddr-cl.opt: Likewise. * src/lsaddr-cl.opt: Likewise. * src/lsattr-cl.opt: Likewise. * src/lsimg-cl.opt: Likewise. * src/lsistat-cl.opt: Likewise. * src/lssg-cl.opt: Likewise. * src/lssnap-cl.opt: Likewise. * src/lstag-cl.opt: Likewise. * src/mkimg-cl.opt: Likewise. * src/mkinst-cl.opt: Likewise. * src/mktags-cl.opt: Likewise. * src/mkvol-cl.opt: Likewise. * src/allocaddr.c: Update calls to parse_options. * src/asscaddr.c: Likewise. * src/cpimg.c: Likewise. * src/cpsnap.c: Likewise. * src/devol.c: Likewise. * src/disasaddr.c: Likewise. * src/freeaddr.c: Likewise. * src/lsaddr.c: Likewise. * src/lsattr.c: Likewise. * src/lsimg.c: Likewise. * src/lsistat.c: Likewise. * src/lssg.c: Likewise. * src/lssnap.c: Likewise. * src/lstag.c: Likewise. * src/mkimg.c: Likewise. * src/mkinst.c: Likewise. * src/mktags.c: Likewise. * src/mkvol.c: Likewise.
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--src/Makefile.am7
-rw-r--r--src/allocaddr-cl.opt14
-rw-r--r--src/allocaddr.c2
-rw-r--r--src/asscaddr-cl.opt14
-rw-r--r--src/asscaddr.c2
-rw-r--r--src/cmdline.opt2
-rw-r--r--src/cpimg-cl.opt14
-rw-r--r--src/cpimg.c2
-rw-r--r--src/cpsnap-cl.opt14
-rw-r--r--src/cpsnap.c2
-rw-r--r--src/devol-cl.opt (copied from src/detvol-cl.opt)14
-rw-r--r--src/devol.c4
-rw-r--r--src/disasaddr-cl.opt16
-rw-r--r--src/disasaddr.c2
-rw-r--r--src/eclat.h1
-rw-r--r--src/eclatcl.m4 (renamed from src/detvol-cl.opt)26
-rw-r--r--src/freeaddr-cl.opt17
-rw-r--r--src/freeaddr.c2
-rw-r--r--src/lsaddr-cl.opt15
-rw-r--r--src/lsaddr.c2
-rw-r--r--src/lsattr-cl.opt14
-rw-r--r--src/lsattr.c2
-rw-r--r--src/lsimg-cl.opt17
-rw-r--r--src/lsimg.c2
-rw-r--r--src/lsistat-cl.opt15
-rw-r--r--src/lsistat.c2
-rw-r--r--src/lssg-cl.opt15
-rw-r--r--src/lssg.c2
-rw-r--r--src/lssnap-cl.opt16
-rw-r--r--src/lssnap.c2
-rw-r--r--src/lstag-cl.opt15
-rw-r--r--src/lstag.c2
-rw-r--r--src/mkimg-cl.opt14
-rw-r--r--src/mkimg.c2
-rw-r--r--src/mkinst-cl.opt15
-rw-r--r--src/mkinst.c2
-rw-r--r--src/mktags-cl.opt14
-rw-r--r--src/mktags.c2
-rw-r--r--src/mkvol-cl.opt14
-rw-r--r--src/mkvol.c2
40 files changed, 136 insertions, 205 deletions
diff --git a/src/Makefile.am b/src/Makefile.am
index ee9eece..d97110a 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -70,7 +70,7 @@ OPTFILES=\
70 asscaddr-cl.opt\ 70 asscaddr-cl.opt\
71 cpimg-cl.opt\ 71 cpimg-cl.opt\
72 cpsnap-cl.opt\ 72 cpsnap-cl.opt\
73 detvol-cl.opt\ 73 devol-cl.opt\
74 disasaddr-cl.opt\ 74 disasaddr-cl.opt\
75 freeaddr-cl.opt\ 75 freeaddr-cl.opt\
76 generic-cl.opt\ 76 generic-cl.opt\
@@ -98,12 +98,13 @@ EXTRA_DIST=\
98 cmdline.opt\ 98 cmdline.opt\
99 $(OPTFILES)\ 99 $(OPTFILES)\
100 comtab.man\ 100 comtab.man\
101 xref.man 101 xref.man\
102 eclatcl.m4
102 103
103SUFFIXES=.opt .c .h 104SUFFIXES=.opt .c .h
104 105
105.opt.h: 106.opt.h:
106 $(AM_V_GEN)m4 -s $(top_srcdir)/grecs/build-aux/getopt.m4 $< | sed '1d' > $@ 107 $(AM_V_GEN)m4 -s $(top_srcdir)/grecs/build-aux/getopt.m4 eclatcl.m4 $< | sed '1d' > $@
107 108
108comtab.man: eclat.c 109comtab.man: eclat.c
109 $(AM_V_GEN)$(top_srcdir)/src/eclat -l '\t\\fB%n\\fR\t\\fB%i\\fR\n' > comtab.man 110 $(AM_V_GEN)$(top_srcdir)/src/eclat -l '\t\\fB%n\\fR\t\\fB%i\\fR\n' > comtab.man
diff --git a/src/allocaddr-cl.opt b/src/allocaddr-cl.opt
index c618375..c29b4f3 100644
--- a/src/allocaddr-cl.opt
+++ b/src/allocaddr-cl.opt
@@ -14,12 +14,7 @@
14 You should have received a copy of the GNU General Public License 14 You should have received a copy of the GNU General Public License
15 along with Eclat. If not, see <http://www.gnu.org/licenses/>. */ 15 along with Eclat. If not, see <http://www.gnu.org/licenses/>. */
16 16
17OPTIONS_COMMAND_BEGIN("eclat", 17ECLAT_CL_BEGIN([<allocate Elastic IP address>])
18 [<allocaddr, allocate-address>],
19 [<allocate Elastic IP address>],
20 [<>],
21 [<gnu>],
22 [<noversion>])
23 18
24OPTION(vpc,v,, 19OPTION(vpc,v,,
25 [<assign VPC addresses>]) 20 [<assign VPC addresses>])
@@ -27,11 +22,10 @@ BEGIN
27 vpc = 1; 22 vpc = 1;
28END 23END
29 24
30OPTIONS_END 25ECLAT_CL_END
31 26
32static void 27ECLAT_CL_PARSER(parse_options, [<int argc, char *argv[], int *index>],[<
33parse_options(int argc, char *argv[], int *index)
34{ 28{
35 GETOPT(argc, argv, *index, exit(EX_USAGE)) 29 GETOPT(argc, argv, *index, exit(EX_USAGE))
36} 30}
37 31>])
diff --git a/src/allocaddr.c b/src/allocaddr.c
index 61736cd..51e58c3 100644
--- a/src/allocaddr.c
+++ b/src/allocaddr.c
@@ -23,7 +23,7 @@ eclat_allocate_address(eclat_command_env_t *env, int argc, char **argv)
23{ 23{
24 int i; 24 int i;
25 25
26 parse_options(argc, argv, &i); 26 parse_options(env, argc, argv, &i);
27 argc -= i; 27 argc -= i;
28 argv += i; 28 argv += i;
29 29
diff --git a/src/asscaddr-cl.opt b/src/asscaddr-cl.opt
index 87846e3..321f7c4 100644
--- a/src/asscaddr-cl.opt
+++ b/src/asscaddr-cl.opt
@@ -14,12 +14,8 @@
14 You should have received a copy of the GNU General Public License 14 You should have received a copy of the GNU General Public License
15 along with Eclat. If not, see <http://www.gnu.org/licenses/>. */ 15 along with Eclat. If not, see <http://www.gnu.org/licenses/>. */
16 16
17OPTIONS_COMMAND_BEGIN("eclat", 17ECLAT_CL_BEGIN([<associate IP address with an instance>],
18 [<asscaddr, associate-address>], 18 [<INSTANCE IP-OR-ALLOC-ID>]);
19 [<associate IP address with an instance>],
20 [<INSTANCE IP-OR-ALLOC-ID>],
21 [<gnu>],
22 [<noversion>])
23 19
24OPTION(vpc,v,, 20OPTION(vpc,v,,
25 [<assign VPC addresses>]) 21 [<assign VPC addresses>])
@@ -45,11 +41,11 @@ BEGIN
45 reassoc = 1; 41 reassoc = 1;
46 END 42 END
47 43
48OPTIONS_END 44ECLAT_CL_END
49 45
50static void 46ECLAT_CL_PARSER(parse_options, [<int argc, char *argv[], int *index>],[<
51parse_options(int argc, char *argv[], int *index)
52{ 47{
53 GETOPT(argc, argv, *index, exit(EX_USAGE)) 48 GETOPT(argc, argv, *index, exit(EX_USAGE))
54} 49}
50>])
55 51
diff --git a/src/asscaddr.c b/src/asscaddr.c
index 859675b..8ec3998 100644
--- a/src/asscaddr.c
+++ b/src/asscaddr.c
@@ -26,7 +26,7 @@ eclat_associate_address(eclat_command_env_t *env, int argc, char **argv)
26{ 26{
27 int i; 27 int i;
28 28
29 parse_options(argc, argv, &i); 29 parse_options(env, argc, argv, &i);
30 argc -= i; 30 argc -= i;
31 argv += i; 31 argv += i;
32 32
diff --git a/src/cmdline.opt b/src/cmdline.opt
index cd8c280..561d7e2 100644
--- a/src/cmdline.opt
+++ b/src/cmdline.opt
@@ -155,7 +155,7 @@ BEGIN
155 END 155 END
156 156
157OPTION(sort,s,, 157OPTION(sort,s,,
158 [<sort the returned XML teee prior to outputting it>]) 158 [<sort the returned XML tree prior to outputting it>])
159BEGIN 159BEGIN
160 sort_option = 1; 160 sort_option = 1;
161 END 161 END
diff --git a/src/cpimg-cl.opt b/src/cpimg-cl.opt
index 4a01386..991c8af 100644
--- a/src/cpimg-cl.opt
+++ b/src/cpimg-cl.opt
@@ -19,12 +19,8 @@ char *image;
19char *name; 19char *name;
20char *descr; 20char *descr;
21 21
22OPTIONS_COMMAND_BEGIN("eclat", 22ECLAT_CL_BEGIN([<copy an AMI from another region>],
23 [<cpimg, copy-image>], 23 [<REGION AMI-ID>])
24 [<copy an AMI from another region>],
25 [<REGION AMI-ID>],
26 [<gnu>],
27 [<noversion>])
28 24
29OPTION(name,n,[<NAME>], 25OPTION(name,n,[<NAME>],
30 [<assign name to the new image>]) 26 [<assign name to the new image>])
@@ -40,10 +36,9 @@ END
40 36
41/* FIXME: The idempotency token */ 37/* FIXME: The idempotency token */
42 38
43OPTIONS_END 39ECLAT_CL_END
44 40
45static void 41ECLAT_CL_PARSER(parse_options, [<int argc, char *argv[]>],[<
46parse_options(int argc, char *argv[])
47{ 42{
48 int idx; 43 int idx;
49 44
@@ -56,3 +51,4 @@ parse_options(int argc, char *argv[])
56 region = argv[0]; 51 region = argv[0];
57 image = argv[1]; 52 image = argv[1];
58} 53}
54>])
diff --git a/src/cpimg.c b/src/cpimg.c
index 53e7d3f..6822ed6 100644
--- a/src/cpimg.c
+++ b/src/cpimg.c
@@ -21,7 +21,7 @@ int
21eclat_copy_image(eclat_command_env_t *env, int argc, char **argv) 21eclat_copy_image(eclat_command_env_t *env, int argc, char **argv)
22{ 22{
23 struct ec2_query *q = env->query; 23 struct ec2_query *q = env->query;
24 parse_options(argc, argv); 24 parse_options(env, argc, argv);
25 25
26 eclat_query_add_param(q, "SourceRegion", region); 26 eclat_query_add_param(q, "SourceRegion", region);
27 eclat_query_add_param(q, "SourceImageId", image); 27 eclat_query_add_param(q, "SourceImageId", image);
diff --git a/src/cpsnap-cl.opt b/src/cpsnap-cl.opt
index 13423b5..e075264 100644
--- a/src/cpsnap-cl.opt
+++ b/src/cpsnap-cl.opt
@@ -18,12 +18,8 @@ char *region;
18char *image; 18char *image;
19char *descr; 19char *descr;
20 20
21OPTIONS_COMMAND_BEGIN("eclat", 21ECLAT_CL_BEGIN([<copy snapshot from another region>],
22 [<cpsnap, copy-snapshot>], 22 [<REGION SNAP-ID>])
23 [<copy snapshot from another region>],
24 [<REGION SNAP-ID>],
25 [<gnu>],
26 [<noversion>])
27 23
28OPTION(description,d,[<DESCR>], 24OPTION(description,d,[<DESCR>],
29 [<description for the new image>]) 25 [<description for the new image>])
@@ -31,10 +27,9 @@ BEGIN
31 descr = optarg; 27 descr = optarg;
32END 28END
33 29
34OPTIONS_END 30ECLAT_CL_END
35 31
36static void 32ECLAT_CL_PARSER(parse_options, [<int argc, char *argv[]>],[<
37parse_options(int argc, char *argv[])
38{ 33{
39 int idx; 34 int idx;
40 35
@@ -47,3 +42,4 @@ parse_options(int argc, char *argv[])
47 region = argv[0]; 42 region = argv[0];
48 image = argv[1]; 43 image = argv[1];
49} 44}
45>])
diff --git a/src/cpsnap.c b/src/cpsnap.c
index 2f0a624..97ca8b5 100644
--- a/src/cpsnap.c
+++ b/src/cpsnap.c
@@ -22,7 +22,7 @@ eclat_copy_snapshot(eclat_command_env_t *env, int argc, char **argv)
22{ 22{
23 struct ec2_query *q = env->query; 23 struct ec2_query *q = env->query;
24 24
25 parse_options(argc, argv); 25 parse_options(env, argc, argv);
26 26
27 eclat_query_add_param(q, "SourceRegion", region); 27 eclat_query_add_param(q, "SourceRegion", region);
28 eclat_query_add_param(q, "SourceSnapshotId", image); 28 eclat_query_add_param(q, "SourceSnapshotId", image);
diff --git a/src/detvol-cl.opt b/src/devol-cl.opt
index 2acf20b..f626f0d 100644
--- a/src/detvol-cl.opt
+++ b/src/devol-cl.opt
@@ -14,12 +14,8 @@
14 You should have received a copy of the GNU General Public License 14 You should have received a copy of the GNU General Public License
15 along with Eclat. If not, see <http://www.gnu.org/licenses/>. */ 15 along with Eclat. If not, see <http://www.gnu.org/licenses/>. */
16 16
17OPTIONS_COMMAND_BEGIN("eclat", 17ECLAT_CL_BEGIN([<detach a volume from instance>],
18 [<devol, detach-volume>], 18 [<VOL-ID [INST-ID [DEV-NAME]]>])
19 [<detach a volume from instance>],
20 [<VOL-ID [INST-ID [DEV-NAME]]>],
21 [<gnu>],
22 [<noversion>])
23 19
24OPTION(force,f,, 20OPTION(force,f,,
25 [<force detachment>]) 21 [<force detachment>])
@@ -27,10 +23,10 @@ BEGIN
27 force = 1; 23 force = 1;
28END 24END
29 25
30OPTIONS_END 26ECLAT_CL_END
31 27
32static void 28ECLAT_CL_PARSER(parse_options, [<int argc, char *argv[], int *index>],[<
33parse_options(int argc, char *argv[], int *index)
34{ 29{
35 GETOPT(argc, argv, *index, exit(EX_USAGE)) 30 GETOPT(argc, argv, *index, exit(EX_USAGE))
36} 31}
32>])
diff --git a/src/devol.c b/src/devol.c
index c4642f8..b575352 100644
--- a/src/devol.c
+++ b/src/devol.c
@@ -16,7 +16,7 @@
16 16
17#include "eclat.h" 17#include "eclat.h"
18int force; 18int force;
19#include "detvol-cl.h" 19#include "devol-cl.h"
20 20
21int 21int
22eclat_detach_volume(eclat_command_env_t *env, int argc, char **argv) 22eclat_detach_volume(eclat_command_env_t *env, int argc, char **argv)
@@ -24,7 +24,7 @@ eclat_detach_volume(eclat_command_env_t *env, int argc, char **argv)
24 int i; 24 int i;
25 struct ec2_query *q = env->query; 25 struct ec2_query *q = env->query;
26 26
27 parse_options(argc, argv, &i); 27 parse_options(env, argc, argv, &i);
28 argc -= i; 28 argc -= i;
29 argv += i; 29 argv += i;
30 30
diff --git a/src/disasaddr-cl.opt b/src/disasaddr-cl.opt
index 0695387..949b05a 100644
--- a/src/disasaddr-cl.opt
+++ b/src/disasaddr-cl.opt
@@ -14,23 +14,19 @@
14 You should have received a copy of the GNU General Public License 14 You should have received a copy of the GNU General Public License
15 along with Eclat. If not, see <http://www.gnu.org/licenses/>. */ 15 along with Eclat. If not, see <http://www.gnu.org/licenses/>. */
16 16
17OPTIONS_COMMAND_BEGIN("eclat", 17ECLAT_CL_BEGIN([<disassociate IP address from instance>],
18 [<disasadr, disassociate-address>], 18 [<IP-OR-ALLOC-ID>])
19 [<disassociate IP address from instance>],
20 [<IP-OR-ALLOC-ID>],
21 [<gnu>],
22 [<noversion>])
23 19
24OPTION(vpc,v,, 20OPTION(vpc,v,,
25 [<disassociate VPC address>]) 21 [<disassociate VPC address>])
26BEGIN 22BEGIN
27 vpc = 1; 23 vpc = 1;
28END 24END
29OPTIONS_END
30 25
31static void 26ECLAT_CL_END
32parse_options(int argc, char *argv[], int *index) 27
28ECLAT_CL_PARSER(parse_options, [<int argc, char *argv[], int *index>], [<
33{ 29{
34 GETOPT(argc, argv, *index, exit(EX_USAGE)) 30 GETOPT(argc, argv, *index, exit(EX_USAGE))
35} 31}
36 32>])
diff --git a/src/disasaddr.c b/src/disasaddr.c
index 93492f4..c739218 100644
--- a/src/disasaddr.c
+++ b/src/disasaddr.c
@@ -24,7 +24,7 @@ eclat_disassociate_address(eclat_command_env_t *env, int argc, char **argv)
24 int i; 24 int i;
25 struct ec2_query *q = env->query; 25 struct ec2_query *q = env->query;
26 26
27 parse_options(argc, argv, &i); 27 parse_options(env, argc, argv, &i);
28 argc -= i; 28 argc -= i;
29 argv += i; 29 argv += i;
30 30
diff --git a/src/eclat.h b/src/eclat.h
index d4d863f..e328b15 100644
--- a/src/eclat.h
+++ b/src/eclat.h
@@ -185,3 +185,4 @@ extern struct grecs_proginfo *generic_proginfo;
185 185
186void set_command_confirmation(const char *name, enum eclat_confirm_mode cfmode, 186void set_command_confirmation(const char *name, enum eclat_confirm_mode cfmode,
187 grecs_locus_t *locus); 187 grecs_locus_t *locus);
188
diff --git a/src/detvol-cl.opt b/src/eclatcl.m4
index 2acf20b..7f688cb 100644
--- a/src/detvol-cl.opt
+++ b/src/eclatcl.m4
@@ -14,23 +14,23 @@
14 You should have received a copy of the GNU General Public License 14 You should have received a copy of the GNU General Public License
15 along with Eclat. If not, see <http://www.gnu.org/licenses/>. */ 15 along with Eclat. If not, see <http://www.gnu.org/licenses/>. */
16 16
17define([<ECLAT_CL_BEGIN>],[<
17OPTIONS_COMMAND_BEGIN("eclat", 18OPTIONS_COMMAND_BEGIN("eclat",
18 [<devol, detach-volume>], 19 [<>],
19 [<detach a volume from instance>], 20 [<$1>],
20 [<VOL-ID [INST-ID [DEV-NAME]]>], 21 [<$2>],
21 [<gnu>], 22 [<gnu>],
22 [<noversion>]) 23 [<noversion>])>])
23 24
24OPTION(force,f,, 25define([<ECLAT_CL_END>],[<OPTIONS_END>])
25 [<force detachment>])
26BEGIN
27 force = 1;
28END
29
30OPTIONS_END
31 26
27define([<ECLAT_CL_PARSER>],[<
32static void 28static void
33parse_options(int argc, char *argv[], int *index) 29$1(eclat_command_env_t *env, $2)
34{ 30{
35 GETOPT(argc, argv, *index, exit(EX_USAGE)) 31 const char *cmds[3] = { env->cmd->name, env->cmd->ident, NULL };
32 proginfo.subcmd = (char**) cmds;
33 $3
36} 34}
35>])
36
diff --git a/src/freeaddr-cl.opt b/src/freeaddr-cl.opt
index 5f3a3f9..be70065 100644
--- a/src/freeaddr-cl.opt
+++ b/src/freeaddr-cl.opt
@@ -14,12 +14,8 @@
14 You should have received a copy of the GNU General Public License 14 You should have received a copy of the GNU General Public License
15 along with Eclat. If not, see <http://www.gnu.org/licenses/>. */ 15 along with Eclat. If not, see <http://www.gnu.org/licenses/>. */
16 16
17OPTIONS_COMMAND_BEGIN("eclat", 17ECLAT_CL_BEGIN([<release Elastic IP address>],
18 [<freeaddr, release-address>], 18 [<IP-OR-ALLOCID>])
19 [<release Elastic IP address>],
20 [<IP-OR-ALLOCID>],
21 [<gnu>],
22 [<noversion>])
23 19
24OPTION(vpc,v,, 20OPTION(vpc,v,,
25 [<assign VPC addresses>]) 21 [<assign VPC addresses>])
@@ -27,11 +23,12 @@ BEGIN
27 vpc = 1; 23 vpc = 1;
28END 24END
29 25
30OPTIONS_END 26ECLAT_CL_END
31 27
32static void 28ECLAT_CL_PARSER(parse_options, [<int argc, char *argv[], int *index>],
33parse_options(int argc, char *argv[], int *index) 29[<
34{ 30{
35 GETOPT(argc, argv, *index, exit(EX_USAGE)) 31 GETOPT(argc, argv, *index, exit(EX_USAGE))
36} 32}
37 33>])
34
diff --git a/src/freeaddr.c b/src/freeaddr.c
index 2cb2ce6..b970248 100644
--- a/src/freeaddr.c
+++ b/src/freeaddr.c
@@ -23,7 +23,7 @@ eclat_release_address(eclat_command_env_t *env, int argc, char **argv)
23{ 23{
24 int i; 24 int i;
25 25
26 parse_options(argc, argv, &i); 26 parse_options(env, argc, argv, &i);
27 argc -= i; 27 argc -= i;
28 argv += i; 28 argv += i;
29 29
diff --git a/src/lsaddr-cl.opt b/src/lsaddr-cl.opt
index 071bb27..c663f51 100644
--- a/src/lsaddr-cl.opt
+++ b/src/lsaddr-cl.opt
@@ -14,12 +14,8 @@
14 You should have received a copy of the GNU General Public License 14 You should have received a copy of the GNU General Public License
15 along with Eclat. If not, see <http://www.gnu.org/licenses/>. */ 15 along with Eclat. If not, see <http://www.gnu.org/licenses/>. */
16 16
17OPTIONS_COMMAND_BEGIN("eclat", 17ECLAT_CL_BEGIN([<describe elastic IP addresses>],
18 [<lsaddr, describe-addresses>], 18 [<[FILTER...]>])
19 [<describe elastic IP addresses>],
20 [<[FILTER...]>],
21 [<gnu>],
22 [<noversion>])
23 19
24OPTION(vpc,v,, 20OPTION(vpc,v,,
25 [<describe VPC addresses>]) 21 [<describe VPC addresses>])
@@ -27,7 +23,7 @@ BEGIN
27 vpc = 1; 23 vpc = 1;
28END 24END
29 25
30OPTIONS_END 26ECLAT_CL_END
31 27
32static char *domain_str[] = { "standard", "vpc", NULL }; 28static char *domain_str[] = { "standard", "vpc", NULL };
33static struct filter_descr filters[] = { 29static struct filter_descr filters[] = {
@@ -42,11 +38,10 @@ static struct filter_descr filters[] = {
42 { NULL } 38 { NULL }
43}; 39};
44 40
45static void 41ECLAT_CL_PARSER(parse_options, [<int argc, char *argv[], int *index>], [<
46parse_options(int argc, char *argv[], int *index)
47{ 42{
48 available_filters = filters; 43 available_filters = filters;
49 proginfo.print_help_hook = list_filters; 44 proginfo.print_help_hook = list_filters;
50 GETOPT(argc, argv, *index, exit(EX_USAGE)) 45 GETOPT(argc, argv, *index, exit(EX_USAGE))
51} 46}
52 47>])
diff --git a/src/lsaddr.c b/src/lsaddr.c
index 09541ad..0c192d7 100644
--- a/src/lsaddr.c
+++ b/src/lsaddr.c
@@ -23,7 +23,7 @@ eclat_describe_addresses(eclat_command_env_t *env, int argc, char **argv)
23{ 23{
24 int i; 24 int i;
25 25
26 parse_options(argc, argv, &i); 26 parse_options(env, argc, argv, &i);
27 argv += i; 27 argv += i;
28 argc -= i; 28 argc -= i;
29 29
diff --git a/src/lsattr-cl.opt b/src/lsattr-cl.opt
index a50deb6..0f3c4ab 100644
--- a/src/lsattr-cl.opt
+++ b/src/lsattr-cl.opt
@@ -14,12 +14,8 @@
14 You should have received a copy of the GNU General Public License 14 You should have received a copy of the GNU General Public License
15 along with Eclat. If not, see <http://www.gnu.org/licenses/>. */ 15 along with Eclat. If not, see <http://www.gnu.org/licenses/>. */
16 16
17OPTIONS_COMMAND_BEGIN("eclat", 17ECLAT_CL_BEGIN([<List EC2 resource attributes>],
18 [<lsattr>], 18 [<ID [ATTR]>])
19 [<List EC2 resource attributes>],
20 [<ID [ATTR]>],
21 [<gnu>],
22 [<noversion>])
23 19
24OPTION(instance,i,, 20OPTION(instance,i,,
25 [<instance ID>]) 21 [<instance ID>])
@@ -35,10 +31,10 @@ BEGIN
35 idname = "SnapshotId"; 31 idname = "SnapshotId";
36END 32END
37 33
38OPTIONS_END 34ECLAT_CL_END
39 35
40static void 36ECLAT_CL_PARSER(parse_options, [<int argc, char *argv[], int *index>],[<
41parse_options(int argc, char *argv[], int *index)
42{ 37{
43 GETOPT(argc, argv, *index, exit(EX_USAGE)) 38 GETOPT(argc, argv, *index, exit(EX_USAGE))
44} 39}
40>])
diff --git a/src/lsattr.c b/src/lsattr.c
index 706be6b..9b49ca3 100644
--- a/src/lsattr.c
+++ b/src/lsattr.c
@@ -25,7 +25,7 @@ eclat_lsattr(eclat_command_env_t *env, int argc, char **argv)
25 int i; 25 int i;
26 struct eclat_command *command; 26 struct eclat_command *command;
27 27
28 parse_options(argc, argv, &i); 28 parse_options(env, argc, argv, &i);
29 29
30 argc -= i; 30 argc -= i;
31 argv += i; 31 argv += i;
diff --git a/src/lsimg-cl.opt b/src/lsimg-cl.opt
index 955b960..57bfb0c 100644
--- a/src/lsimg-cl.opt
+++ b/src/lsimg-cl.opt
@@ -17,12 +17,8 @@
17static int owner_n; 17static int owner_n;
18static int xby_n; 18static int xby_n;
19 19
20OPTIONS_COMMAND_BEGIN("eclat", 20ECLAT_CL_BEGIN([<describe Amazon images>],
21 [<lsimg, describe-images>], 21 [<[FILTER...] [AMI...]>])
22 [<describe Amazon images>],
23 [<[FILTER...] [AMI...]>],
24 [<gnu>],
25 [<noversion>])
26 22
27OPTION(all,a,, 23OPTION(all,a,,
28 [<describe all images>]) 24 [<describe all images>])
@@ -45,11 +41,11 @@ BEGIN
45 eclat_query_add_param(q, bufptr, optarg); 41 eclat_query_add_param(q, bufptr, optarg);
46END 42END
47 43
48OPTIONS_END 44ECLAT_CL_END
49 45
50static void 46ECLAT_CL_PARSER(parse_options,[<int argc, char *argv[], int *idx>], [<
51parse_options(struct ec2_query *q, int argc, char *argv[], int *idx)
52{ 47{
48 struct ec2_query *q = env->query;
53 char *bufptr = NULL; 49 char *bufptr = NULL;
54 size_t bufsize = 0; 50 size_t bufsize = 0;
55 static char *arch[] = {"i386", "x86_64", NULL }; 51 static char *arch[] = {"i386", "x86_64", NULL };
@@ -98,7 +94,8 @@ parse_options(struct ec2_query *q, int argc, char *argv[], int *idx)
98 GETOPT(argc, argv, *idx, exit(EX_USAGE)) 94 GETOPT(argc, argv, *idx, exit(EX_USAGE))
99 free(bufptr); 95 free(bufptr);
100} 96}
101 97>]
98)
102 99
103 100
104 101
diff --git a/src/lsimg.c b/src/lsimg.c
index 4be377b..db3c98b 100644
--- a/src/lsimg.c
+++ b/src/lsimg.c
@@ -22,7 +22,7 @@ eclat_describe_images(eclat_command_env_t *env, int argc, char **argv)
22{ 22{
23 int i; 23 int i;
24 24
25 parse_options(env->query, argc, argv, &i); 25 parse_options(env, argc, argv, &i);
26 26
27 argc -= i; 27 argc -= i;
28 argv += i; 28 argv += i;
diff --git a/src/lsistat-cl.opt b/src/lsistat-cl.opt
index 2807b73..470f570 100644
--- a/src/lsistat-cl.opt
+++ b/src/lsistat-cl.opt
@@ -14,12 +14,8 @@
14 You should have received a copy of the GNU General Public License 14 You should have received a copy of the GNU General Public License
15 along with Eclat. If not, see <http://www.gnu.org/licenses/>. */ 15 along with Eclat. If not, see <http://www.gnu.org/licenses/>. */
16 16
17OPTIONS_COMMAND_BEGIN("eclat", 17ECLAT_CL_BEGIN([<describe the status of Amazon EC2 instances including any scheduled events>],
18 [<lsistat, describe-instance-status>], 18 [<[FILTER...]>])
19 [<describe the status of Amazon EC2 instances including any scheduled events>],
20 [<[FILTER...]>],
21 [<gnu>],
22 [<noversion>])
23 19
24OPTION(all,a,, 20OPTION(all,a,,
25 [<return the health status for all instances>]) 21 [<return the health status for all instances>])
@@ -27,10 +23,9 @@ BEGIN
27 all_option = 1; 23 all_option = 1;
28END 24END
29 25
30OPTIONS_END 26ECLAT_CL_END
31 27
32static void 28ECLAT_CL_PARSER(parse_options, [<int argc, char *argv[], int *index>], [<
33parse_options(int argc, char *argv[], int *index)
34{ 29{
35 static char *event_codes[] = { 30 static char *event_codes[] = {
36 "instance-reboot", 31 "instance-reboot",
@@ -101,7 +96,9 @@ parse_options(int argc, char *argv[], int *index)
101 FILTER_ENUM, instance_reachability }, 96 FILTER_ENUM, instance_reachability },
102 { NULL } 97 { NULL }
103 }; 98 };
99
104 available_filters = filters; 100 available_filters = filters;
105 proginfo.print_help_hook = list_filters; 101 proginfo.print_help_hook = list_filters;
106 GETOPT(argc, argv, *index, exit(EX_USAGE)) 102 GETOPT(argc, argv, *index, exit(EX_USAGE))
107} 103}
104>])
diff --git a/src/lsistat.c b/src/lsistat.c
index 00dd101..c9a518a 100644
--- a/src/lsistat.c
+++ b/src/lsistat.c
@@ -23,7 +23,7 @@ eclat_describe_instance_status(eclat_command_env_t *env, int argc, char **argv)
23{ 23{
24 int i; 24 int i;
25 25
26 parse_options(argc, argv, &i); 26 parse_options(env, argc, argv, &i);
27 argv += i; 27 argv += i;
28 argc -= i; 28 argc -= i;
29 translate_ids(argc, argv, "InstanceId"); 29 translate_ids(argc, argv, "InstanceId");
diff --git a/src/lssg-cl.opt b/src/lssg-cl.opt
index 3898708..77dde5b 100644
--- a/src/lssg-cl.opt
+++ b/src/lssg-cl.opt
@@ -14,12 +14,8 @@
14 You should have received a copy of the GNU General Public License 14 You should have received a copy of the GNU General Public License
15 along with Eclat. If not, see <http://www.gnu.org/licenses/>. */ 15 along with Eclat. If not, see <http://www.gnu.org/licenses/>. */
16 16
17OPTIONS_COMMAND_BEGIN("eclat", 17ECLAT_CL_BEGIN([<returns information about security groups>],
18 [<lssg, describe-security-groups>], 18 [<[FILTER...] [ID...]>])
19 [<returns information about security groups>],
20 [<[FILTER...] [ID...]>],
21 [<gnu>],
22 [<noversion>])
23 19
24OPTION(name,n,, 20OPTION(name,n,,
25 [<treat non-filter arguments as group names, instead of group IDs>]) 21 [<treat non-filter arguments as group names, instead of group IDs>])
@@ -27,7 +23,7 @@ BEGIN
27 name_option = 1; 23 name_option = 1;
28END 24END
29 25
30OPTIONS_END 26ECLAT_CL_END
31 27
32static char *proto_str[] = { 28static char *proto_str[] = {
33 "tcp", "udp", "icmp", "or a protocol number", NULL 29 "tcp", "udp", "icmp", "or a protocol number", NULL
@@ -49,11 +45,10 @@ static struct filter_descr filters[] = {
49 { NULL } 45 { NULL }
50}; 46};
51 47
52static void 48ECLAT_CL_PARSER(parse_options, [<int argc, char *argv[], int *index>],[<
53parse_options(int argc, char *argv[], int *index)
54{ 49{
55 available_filters = filters; 50 available_filters = filters;
56 proginfo.print_help_hook = list_filters; 51 proginfo.print_help_hook = list_filters;
57 GETOPT(argc, argv, *index, exit(EX_USAGE)) 52 GETOPT(argc, argv, *index, exit(EX_USAGE))
58} 53}
59 54>])
diff --git a/src/lssg.c b/src/lssg.c
index d691f47..b3bd633 100644
--- a/src/lssg.c
+++ b/src/lssg.c
@@ -24,7 +24,7 @@ eclat_describe_security_groups(eclat_command_env_t *env, int argc, char **argv)
24 int i; 24 int i;
25 const char *resid = name_option ? "GroupName" : "GroupId"; 25 const char *resid = name_option ? "GroupName" : "GroupId";
26 26
27 parse_options(argc, argv, &i); 27 parse_options(env, argc, argv, &i);
28 argv += i; 28 argv += i;
29 argc -= i; 29 argc -= i;
30 translate_ids(argc, argv, resid); 30 translate_ids(argc, argv, resid);
diff --git a/src/lssnap-cl.opt b/src/lssnap-cl.opt
index be1f0d9..bb020ca 100644
--- a/src/lssnap-cl.opt
+++ b/src/lssnap-cl.opt
@@ -24,12 +24,8 @@ struct param {
24 24
25static unsigned owner_idx = 1, rstby_idx = 1; 25static unsigned owner_idx = 1, rstby_idx = 1;
26 26
27OPTIONS_COMMAND_BEGIN("eclat", 27ECLAT_CL_BEGIN([<describe EC2 snapshots>],
28 [<lssnap, describe-snapshots>], 28 [<[SNAP-ID...] [FILTER...]]>])
29 [<describe EC2 snapshots>],
30 [<[SNAP-ID...] [FILTER...]]>],
31 [<gnu>],
32 [<noversion>])
33 29
34OPTION(owner,u,[<ID|self|amazon>], 30OPTION(owner,u,[<ID|self|amazon>],
35 [<return the snapshots owned by the specified owner>]) 31 [<return the snapshots owned by the specified owner>])
@@ -50,12 +46,12 @@ BEGIN
50 p->value = optarg; 46 p->value = optarg;
51 grecs_list_append(parmlist, p); 47 grecs_list_append(parmlist, p);
52END 48END
49
50ECLAT_CL_END
53 51
54OPTIONS_END 52ECLAT_CL_PARSER(parse_options, [<int argc, char *argv[], int *index>], [<
55
56static void
57parse_options(int argc, char *argv[], int *index)
58{ 53{
59 parmlist = grecs_list_create(); 54 parmlist = grecs_list_create();
60 GETOPT(argc, argv, *index, exit(EX_USAGE)) 55 GETOPT(argc, argv, *index, exit(EX_USAGE))
61} 56}
57>])
diff --git a/src/lssnap.c b/src/lssnap.c
index 3494a8b..d60e048 100644
--- a/src/lssnap.c
+++ b/src/lssnap.c
@@ -48,7 +48,7 @@ eclat_describe_snapshots(eclat_command_env_t *env, int argc, char **argv)
48 48
49 available_filters = filters; 49 available_filters = filters;
50 proginfo.print_help_hook = list_filters; 50 proginfo.print_help_hook = list_filters;
51 parse_options(argc, argv, &i); 51 parse_options(env, argc, argv, &i);
52 argc -= i; 52 argc -= i;
53 argv += i; 53 argv += i;
54 translate_ids(argc, argv, "SnapshotId"); 54 translate_ids(argc, argv, "SnapshotId");
diff --git a/src/lstag-cl.opt b/src/lstag-cl.opt
index af8064d..dfb8fc0 100644
--- a/src/lstag-cl.opt
+++ b/src/lstag-cl.opt
@@ -21,12 +21,8 @@ struct resource {
21 char *resid; 21 char *resid;
22}; 22};
23 23
24OPTIONS_COMMAND_BEGIN("eclat", 24ECLAT_CL_BEGIN([<List tags and their values>],
25 [<lstag, describe-tags>], 25 [<[FILTER...]>])
26 [<List tags and their values>],
27 [<[FILTER...]>],
28 [<gnu>],
29 [<noversion>])
30 26
31OPTION(resource-id,r,[<[MAP:]ID>], 27OPTION(resource-id,r,[<[MAP:]ID>],
32 [<resource for which to list the tags>]) 28 [<resource for which to list the tags>])
@@ -80,10 +76,9 @@ BEGIN
80 grecs_list_append(reslist, res); 76 grecs_list_append(reslist, res);
81END 77END
82 78
83OPTIONS_END 79ECLAT_CL_END
84 80
85static void 81ECLAT_CL_PARSER(parse_options, [<int argc, char *argv[], int *index>],[<
86parse_options(int argc, char *argv[], int *index)
87{ 82{
88 static char *resource_types[] = { 83 static char *resource_types[] = {
89 "customer-gateway", 84 "customer-gateway",
@@ -113,9 +108,11 @@ parse_options(int argc, char *argv[], int *index)
113 { NULL } 108 { NULL }
114 }; 109 };
115 110
111
116 available_filters = filters; 112 available_filters = filters;
117 proginfo.print_help_hook = list_filters; 113 proginfo.print_help_hook = list_filters;
118 114
119 reslist = grecs_list_create(); 115 reslist = grecs_list_create();
120 GETOPT(argc, argv, *index, exit(EX_USAGE)) 116 GETOPT(argc, argv, *index, exit(EX_USAGE))
121} 117}
118>])
diff --git a/src/lstag.c b/src/lstag.c
index 49c165b..5532294 100644
--- a/src/lstag.c
+++ b/src/lstag.c
@@ -26,7 +26,7 @@ eclat_describe_tags(eclat_command_env_t *env, int argc, char **argv)
26 struct grecs_list_entry *ep; 26 struct grecs_list_entry *ep;
27 int n = 1; 27 int n = 1;
28 28
29 parse_options(argc, argv, &i); 29 parse_options(env, argc, argv, &i);
30 argv += i; 30 argv += i;
31 argc -= i; 31 argc -= i;
32 translate_resource_ids(argc, argv); 32 translate_resource_ids(argc, argv);
diff --git a/src/mkimg-cl.opt b/src/mkimg-cl.opt
index d905773..bb3fc42 100644
--- a/src/mkimg-cl.opt
+++ b/src/mkimg-cl.opt
@@ -14,12 +14,8 @@
14 You should have received a copy of the GNU General Public License 14 You should have received a copy of the GNU General Public License
15 along with Eclat. If not, see <http://www.gnu.org/licenses/>. */ 15 along with Eclat. If not, see <http://www.gnu.org/licenses/>. */
16 16
17OPTIONS_COMMAND_BEGIN("eclat", 17ECLAT_CL_BEGIN([<create an AMI>],
18 [<mkimg, create-image>], 18 [<NAME INSTANCE>])
19 [<create an AMI>],
20 [<NAME INSTANCE>],
21 [<gnu>],
22 [<noversion>])
23 19
24OPTION(description,d,[<STRING>], 20OPTION(description,d,[<STRING>],
25 [<image description>]) 21 [<image description>])
@@ -43,10 +39,10 @@ BEGIN
43 grecs_list_append(devmap, optarg); 39 grecs_list_append(devmap, optarg);
44END 40END
45 41
46OPTIONS_END 42ECLAT_CL_END
47 43
48static void 44ECLAT_CL_PARSER(parse_options, [<int argc, char *argv[], int *index>],[<
49parse_options(int argc, char *argv[], int *index)
50{ 45{
51 GETOPT(argc, argv, *index, exit(EX_USAGE)) 46 GETOPT(argc, argv, *index, exit(EX_USAGE))
52} 47}
48>])
diff --git a/src/mkimg.c b/src/mkimg.c
index 021dce9..a34c302 100644
--- a/src/mkimg.c
+++ b/src/mkimg.c
@@ -26,7 +26,7 @@ eclat_create_image(eclat_command_env_t *env, int argc, char **argv)
26 int i; 26 int i;
27 struct ec2_query *q = env->query; 27 struct ec2_query *q = env->query;
28 28
29 parse_options(argc, argv, &i); 29 parse_options(env, argc, argv, &i);
30 argc -= i; 30 argc -= i;
31 argv += i; 31 argv += i;
32 if (argc != 2) 32 if (argc != 2)
diff --git a/src/mkinst-cl.opt b/src/mkinst-cl.opt
index 15778d1..62654f0 100644
--- a/src/mkinst-cl.opt
+++ b/src/mkinst-cl.opt
@@ -61,12 +61,8 @@ read_user_data(const char *file)
61 user_data[st.st_size] = 0; 61 user_data[st.st_size] = 0;
62} 62}
63 63
64OPTIONS_COMMAND_BEGIN("eclat", 64ECLAT_CL_BEGIN([<launch new instances>],
65 [<mkinst, run-instances>], 65 [<AMI-ID>])
66 [<launch new instances>],
67 [<AMI-ID>],
68 [<gnu>],
69 [<noversion>])
70 66
71OPTION(,n,[<N>], 67OPTION(,n,[<N>],
72 [<number of instances to launch>]) 68 [<number of instances to launch>])
@@ -218,14 +214,15 @@ BEGIN
218 ebs_opt = 1; 214 ebs_opt = 1;
219END 215END
220 216
221OPTIONS_END 217ECLAT_CL_END
222 218
223static void 219ECLAT_CL_PARSER(parse_options, [<int argc, char *argv[]>],[<
224parse_options(int argc, char *argv[])
225{ 220{
226 int idx; 221 int idx;
222
227 GETOPT(argc, argv, idx, exit(EX_USAGE)) 223 GETOPT(argc, argv, idx, exit(EX_USAGE))
228 if (idx != argc-1) 224 if (idx != argc-1)
229 die(EX_USAGE, "bad number of arguments"); 225 die(EX_USAGE, "bad number of arguments");
230 ami = argv[idx]; 226 ami = argv[idx];
231} 227}
228>])
diff --git a/src/mkinst.c b/src/mkinst.c
index 8871f0e..359ad7b 100644
--- a/src/mkinst.c
+++ b/src/mkinst.c
@@ -138,7 +138,7 @@ eclat_run_instances(eclat_command_env_t *env, int argc, char **argv)
138 char *p; 138 char *p;
139 int iface_no = 1; 139 int iface_no = 1;
140 140
141 parse_options(argc, argv); 141 parse_options(env, argc, argv);
142 142
143 eclat_query_add_param(q, "ImageId", ami); 143 eclat_query_add_param(q, "ImageId", ami);
144 p = strchr(instance_count, '-'); 144 p = strchr(instance_count, '-');
diff --git a/src/mktags-cl.opt b/src/mktags-cl.opt
index 9da23ae..e622db8 100644
--- a/src/mktags-cl.opt
+++ b/src/mktags-cl.opt
@@ -22,12 +22,8 @@ struct resource {
22 char *resid; 22 char *resid;
23}; 23};
24 24
25OPTIONS_COMMAND_BEGIN("eclat", 25ECLAT_CL_BEGIN([<create tags for the specified resources>],
26 [<mktags, create-tags>], 26 [<TAG[=VALUE] [TAG[=VALUE...]]>])
27 [<create tags for the specified resources>],
28 [<TAG[=VALUE] [TAG[=VALUE...]]>],
29 [<gnu>],
30 [<noversion>])
31 27
32OPTION(resource-id,r,[<[MAP:]ID>], 28OPTION(resource-id,r,[<[MAP:]ID>],
33 [<resource for which to create the tags>]) 29 [<resource for which to create the tags>])
@@ -87,11 +83,11 @@ BEGIN
87 from_file = optarg; 83 from_file = optarg;
88END 84END
89 85
90OPTIONS_END 86ECLAT_CL_END
91 87
92static void 88ECLAT_CL_PARSER(parse_options, [<int argc, char *argv[], int *index>],[<
93parse_options(int argc, char *argv[], int *index)
94{ 89{
95 reslist = grecs_list_create(); 90 reslist = grecs_list_create();
96 GETOPT(argc, argv, *index, exit(EX_USAGE)) 91 GETOPT(argc, argv, *index, exit(EX_USAGE))
97} 92}
93>])
diff --git a/src/mktags.c b/src/mktags.c
index 3a7a272..1d6f551 100644
--- a/src/mktags.c
+++ b/src/mktags.c
@@ -28,7 +28,7 @@ process_tags(eclat_command_env_t *env, int argc, char **argv, int require_tags)
28 28
29 if (!require_tags) 29 if (!require_tags)
30 proginfo.args_doc = "[TAG[=VALUE...]]"; 30 proginfo.args_doc = "[TAG[=VALUE...]]";
31 parse_options(argc, argv, &i); 31 parse_options(env, argc, argv, &i);
32 argv += i; 32 argv += i;
33 argc -= i; 33 argc -= i;
34 34
diff --git a/src/mkvol-cl.opt b/src/mkvol-cl.opt
index 1f21637..c79d612 100644
--- a/src/mkvol-cl.opt
+++ b/src/mkvol-cl.opt
@@ -14,12 +14,8 @@
14 You should have received a copy of the GNU General Public License 14 You should have received a copy of the GNU General Public License
15 along with Eclat. If not, see <http://www.gnu.org/licenses/>. */ 15 along with Eclat. If not, see <http://www.gnu.org/licenses/>. */
16 16
17OPTIONS_COMMAND_BEGIN("eclat", 17ECLAT_CL_BEGIN([<create EC2 volume>],
18 [<mkvol, create-volume>], 18 [<SIZE ZONE>])
19 [<create EC2 volume>],
20 [<SIZE ZONE>],
21 [<gnu>],
22 [<noversion>])
23 19
24OPTION(iops,i,[<IOPS>], 20OPTION(iops,i,[<IOPS>],
25 [<number of I/O operations per second>]) 21 [<number of I/O operations per second>])
@@ -36,10 +32,10 @@ BEGIN
36 snapshot = optarg; 32 snapshot = optarg;
37END 33END
38 34
39OPTIONS_END 35ECLAT_CL_END
40 36
41static void 37ECLAT_CL_PARSER(parse_options, [<int argc, char *argv[], int *index>],[<
42parse_options(int argc, char *argv[], int *index)
43{ 38{
44 GETOPT(argc, argv, *index, exit(EX_USAGE)) 39 GETOPT(argc, argv, *index, exit(EX_USAGE))
45} 40}
41>])
diff --git a/src/mkvol.c b/src/mkvol.c
index 265f012..a2f4921 100644
--- a/src/mkvol.c
+++ b/src/mkvol.c
@@ -26,7 +26,7 @@ eclat_create_volume(eclat_command_env_t *env, int argc, char **argv)
26 int i; 26 int i;
27 struct ec2_query *q = env->query; 27 struct ec2_query *q = env->query;
28 28
29 parse_options(argc, argv, &i); 29 parse_options(env, argc, argv, &i);
30 argc -= i; 30 argc -= i;
31 argv += i; 31 argv += i;
32 if (argc != 2) 32 if (argc != 2)

Return to:

Send suggestions and report system problems to the System administrator.