aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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 (renamed 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.m436
-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, 159 insertions, 192 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;
46END 42END
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
155END 155END
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;
161END 161END
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);