aboutsummaryrefslogtreecommitdiff
path: root/src/identity
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2019-05-09 18:58:06 +0200
committerChristian Grothoff <christian@grothoff.org>2019-05-09 18:58:15 +0200
commitc827d5eefc314ae022a79ca79c2029ab0fe5b898 (patch)
tree58a58ff8a490842d5e05c300d9ad4e01264806d3 /src/identity
parent4e35e0bacaf1a6e2ab7a98f0a729f5ea493aef3d (diff)
downloadgnunet-c827d5eefc314ae022a79ca79c2029ab0fe5b898.tar.gz
gnunet-c827d5eefc314ae022a79ca79c2029ab0fe5b898.zip
add -q option to restrict output to just the public key
Diffstat (limited to 'src/identity')
-rw-r--r--src/identity/gnunet-identity.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/src/identity/gnunet-identity.c b/src/identity/gnunet-identity.c
index 8366b9918..635c59efd 100644
--- a/src/identity/gnunet-identity.c
+++ b/src/identity/gnunet-identity.c
@@ -56,6 +56,11 @@ static int monitor;
56static unsigned int verbose; 56static unsigned int verbose;
57 57
58/** 58/**
59 * Was "quiet" specified?
60 */
61static int quiet;
62
63/**
59 * -C option 64 * -C option
60 */ 65 */
61static char *create_ego; 66static char *create_ego;
@@ -293,7 +298,12 @@ print_ego (void *cls,
293 GNUNET_IDENTITY_ego_get_public_key (ego, &pk); 298 GNUNET_IDENTITY_ego_get_public_key (ego, &pk);
294 s = GNUNET_CRYPTO_ecdsa_public_key_to_string (&pk); 299 s = GNUNET_CRYPTO_ecdsa_public_key_to_string (&pk);
295 if ((monitor) || (NULL != identifier)) 300 if ((monitor) || (NULL != identifier))
296 fprintf (stdout, "%s - %s\n", identifier, s); 301 {
302 if (quiet)
303 fprintf (stdout, "%s\n", s);
304 else
305 fprintf (stdout, "%s - %s\n", identifier, s);
306 }
297 GNUNET_free (s); 307 GNUNET_free (s);
298} 308}
299 309
@@ -354,6 +364,10 @@ main (int argc, char *const *argv)
354 "display", 364 "display",
355 gettext_noop ("display all egos"), 365 gettext_noop ("display all egos"),
356 &list), 366 &list),
367 GNUNET_GETOPT_option_flag ('q',
368 "quiet",
369 gettext_noop ("reduce output"),
370 &quiet),
357 GNUNET_GETOPT_option_string ( 371 GNUNET_GETOPT_option_string (
358 'e', 372 'e',
359 "ego", 373 "ego",