From c827d5eefc314ae022a79ca79c2029ab0fe5b898 Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Thu, 9 May 2019 18:58:06 +0200 Subject: add -q option to restrict output to just the public key --- src/identity/gnunet-identity.c | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'src/identity') 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 @@ -55,6 +55,11 @@ static int monitor; */ static unsigned int verbose; +/** + * Was "quiet" specified? + */ +static int quiet; + /** * -C option */ @@ -293,7 +298,12 @@ print_ego (void *cls, GNUNET_IDENTITY_ego_get_public_key (ego, &pk); s = GNUNET_CRYPTO_ecdsa_public_key_to_string (&pk); if ((monitor) || (NULL != identifier)) - fprintf (stdout, "%s - %s\n", identifier, s); + { + if (quiet) + fprintf (stdout, "%s\n", s); + else + fprintf (stdout, "%s - %s\n", identifier, s); + } GNUNET_free (s); } @@ -354,6 +364,10 @@ main (int argc, char *const *argv) "display", gettext_noop ("display all egos"), &list), + GNUNET_GETOPT_option_flag ('q', + "quiet", + gettext_noop ("reduce output"), + &quiet), GNUNET_GETOPT_option_string ( 'e', "ego", -- cgit v1.2.3