diff options
author | Martin Schanzenbach <mschanzenbach@posteo.de> | 2012-05-08 15:12:25 +0000 |
---|---|---|
committer | Martin Schanzenbach <mschanzenbach@posteo.de> | 2012-05-08 15:12:25 +0000 |
commit | a40497e6ad6e44cc51d7cf829862e739da00aed2 (patch) | |
tree | 92f709cc38a6e4ae10f06e9f1a67cac88adcc9c6 /src/gns/gnunet-gns.c | |
parent | d264f516533751356e265a70b9f9e5ae23dd3bdc (diff) | |
download | gnunet-a40497e6ad6e44cc51d7cf829862e739da00aed2.tar.gz gnunet-a40497e6ad6e44cc51d7cf829862e739da00aed2.zip |
-needed for nss plugin
Diffstat (limited to 'src/gns/gnunet-gns.c')
-rw-r--r-- | src/gns/gnunet-gns.c | 25 |
1 files changed, 19 insertions, 6 deletions
diff --git a/src/gns/gnunet-gns.c b/src/gns/gnunet-gns.c index b7102eaa9..c17f15be3 100644 --- a/src/gns/gnunet-gns.c +++ b/src/gns/gnunet-gns.c | |||
@@ -57,6 +57,11 @@ static char *lookup_type; | |||
57 | */ | 57 | */ |
58 | static char *auth_name; | 58 | static char *auth_name; |
59 | 59 | ||
60 | /** | ||
61 | * raw output | ||
62 | */ | ||
63 | static int raw; | ||
64 | |||
60 | static enum GNUNET_GNS_RecordType rtype; | 65 | static enum GNUNET_GNS_RecordType rtype; |
61 | 66 | ||
62 | /** | 67 | /** |
@@ -92,11 +97,13 @@ process_lookup_result(void* cls, uint32_t rd_count, | |||
92 | char* name = (char*) cls; | 97 | char* name = (char*) cls; |
93 | const char* typename; | 98 | const char* typename; |
94 | char* string_val; | 99 | char* string_val; |
95 | 100 | ||
96 | if (rd_count == 0) | 101 | if (!raw) { |
97 | printf("No results.\n"); | 102 | if (rd_count == 0) |
98 | else | 103 | printf("No results.\n"); |
99 | printf("%s:\n", name); | 104 | else |
105 | printf("%s:\n", name); | ||
106 | } | ||
100 | 107 | ||
101 | 108 | ||
102 | 109 | ||
@@ -106,7 +113,10 @@ process_lookup_result(void* cls, uint32_t rd_count, | |||
106 | string_val = GNUNET_NAMESTORE_value_to_string(rd[i].record_type, | 113 | string_val = GNUNET_NAMESTORE_value_to_string(rd[i].record_type, |
107 | rd[i].data, | 114 | rd[i].data, |
108 | rd[i].data_size); | 115 | rd[i].data_size); |
109 | printf("Got %s record: %s\n", typename, string_val); | 116 | if (raw) |
117 | printf("%s\n", string_val); | ||
118 | else | ||
119 | printf("Got %s record: %s\n", typename, string_val); | ||
110 | 120 | ||
111 | } | 121 | } |
112 | 122 | ||
@@ -193,6 +203,9 @@ main (int argc, char *const *argv) | |||
193 | {'t', "type", NULL, | 203 | {'t', "type", NULL, |
194 | gettext_noop ("Specify the type of the record lookup"), 1, | 204 | gettext_noop ("Specify the type of the record lookup"), 1, |
195 | &GNUNET_GETOPT_set_string, &lookup_type}, | 205 | &GNUNET_GETOPT_set_string, &lookup_type}, |
206 | {'r', "raw", NULL, | ||
207 | gettext_noop ("No unneeded output"), 0, | ||
208 | &GNUNET_GETOPT_set_one, &raw}, | ||
196 | GNUNET_GETOPT_OPTION_END | 209 | GNUNET_GETOPT_OPTION_END |
197 | }; | 210 | }; |
198 | 211 | ||