diff options
author | Christian Grothoff <christian@grothoff.org> | 2012-03-04 16:19:07 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2012-03-04 16:19:07 +0000 |
commit | 21ac0fa547fee3def262d94ba4dd62e5960e3d9f (patch) | |
tree | b23d117344693b84015d3ae5436a9f406291b681 /src/gns/gnunet-gns.c | |
parent | 9761c89280fe637c7dd78d6701d45695be93fcec (diff) | |
download | gnunet-21ac0fa547fee3def262d94ba4dd62e5960e3d9f.tar.gz gnunet-21ac0fa547fee3def262d94ba4dd62e5960e3d9f.zip |
-adding options to gnunet-gns
Diffstat (limited to 'src/gns/gnunet-gns.c')
-rw-r--r-- | src/gns/gnunet-gns.c | 59 |
1 files changed, 57 insertions, 2 deletions
diff --git a/src/gns/gnunet-gns.c b/src/gns/gnunet-gns.c index a56b229b5..b56423c04 100644 --- a/src/gns/gnunet-gns.c +++ b/src/gns/gnunet-gns.c | |||
@@ -48,6 +48,41 @@ static struct GNUNET_CRYPTO_RsaPrivateKey *zone_pkey; | |||
48 | * Keyfile to manipulate. | 48 | * Keyfile to manipulate. |
49 | */ | 49 | */ |
50 | static char *keyfile; | 50 | static char *keyfile; |
51 | |||
52 | /** | ||
53 | * Desired action is to add a record. | ||
54 | */ | ||
55 | static int add; | ||
56 | |||
57 | /** | ||
58 | * Desired action is to list records. | ||
59 | */ | ||
60 | static int list; | ||
61 | |||
62 | /** | ||
63 | * Desired action is to remove a record. | ||
64 | */ | ||
65 | static int del; | ||
66 | |||
67 | /** | ||
68 | * Name of the records to add/list/remove. | ||
69 | */ | ||
70 | static char *name; | ||
71 | |||
72 | /** | ||
73 | * Value of the record to add/remove. | ||
74 | */ | ||
75 | static char *value; | ||
76 | |||
77 | /** | ||
78 | * Type of the record to add/remove, NULL to remove all. | ||
79 | */ | ||
80 | static char *typestring; | ||
81 | |||
82 | /** | ||
83 | * Desired expiration time. | ||
84 | */ | ||
85 | static char *expirationstring; | ||
51 | 86 | ||
52 | 87 | ||
53 | /** | 88 | /** |
@@ -113,8 +148,7 @@ run (void *cls, char *const *args, const char *cfgfile, | |||
113 | _("Failed to connect to namestore\n")); | 148 | _("Failed to connect to namestore\n")); |
114 | return; | 149 | return; |
115 | } | 150 | } |
116 | GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_FOREVER_REL, | 151 | GNUNET_SCHEDULER_add_now (&do_shutdown, NULL); |
117 | &do_shutdown, NULL); | ||
118 | } | 152 | } |
119 | 153 | ||
120 | 154 | ||
@@ -129,6 +163,27 @@ int | |||
129 | main (int argc, char *const *argv) | 163 | main (int argc, char *const *argv) |
130 | { | 164 | { |
131 | static const struct GNUNET_GETOPT_CommandLineOption options[] = { | 165 | static const struct GNUNET_GETOPT_CommandLineOption options[] = { |
166 | {'a', "add", NULL, | ||
167 | gettext_noop ("add record"), 0, | ||
168 | &GNUNET_GETOPT_set_one, &add}, | ||
169 | {'d', "delete", NULL, | ||
170 | gettext_noop ("delete record"), 0, | ||
171 | &GNUNET_GETOPT_set_one, &del}, | ||
172 | {'D', "display", NULL, | ||
173 | gettext_noop ("display records"), 0, | ||
174 | &GNUNET_GETOPT_set_one, &list}, | ||
175 | {'e', "expiration", "TIME", | ||
176 | gettext_noop ("expiration time to use (for adding only)"), 1, | ||
177 | &GNUNET_GETOPT_set_string, &expirationstring}, | ||
178 | {'n', "name", "NAME", | ||
179 | gettext_noop ("name of the record to add/delete/display"), 1, | ||
180 | &GNUNET_GETOPT_set_string, &name}, | ||
181 | {'t', "type", "TYPE", | ||
182 | gettext_noop ("type of the record to add/delete/display"), 1, | ||
183 | &GNUNET_GETOPT_set_string, &typestring}, | ||
184 | {'V', "value", "VALUE", | ||
185 | gettext_noop ("value of the record to add/delete"), 1, | ||
186 | &GNUNET_GETOPT_set_string, &value}, | ||
132 | {'z', "zonekey", "FILENAME", | 187 | {'z', "zonekey", "FILENAME", |
133 | gettext_noop ("filename with the zone key"), 1, | 188 | gettext_noop ("filename with the zone key"), 1, |
134 | &GNUNET_GETOPT_set_string, &keyfile}, | 189 | &GNUNET_GETOPT_set_string, &keyfile}, |