[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] [gnunet] 02/02: add -q option to restrict output to just th
From: |
gnunet |
Subject: |
[GNUnet-SVN] [gnunet] 02/02: add -q option to restrict output to just the public key |
Date: |
Thu, 09 May 2019 18:58:39 +0200 |
This is an automated email from the git hooks/post-receive script.
grothoff pushed a commit to branch master
in repository gnunet.
commit c827d5eefc314ae022a79ca79c2029ab0fe5b898
Author: Christian Grothoff <address@hidden>
AuthorDate: Thu May 9 18:58:06 2019 +0200
add -q option to restrict output to just the public key
---
doc/man/gnunet-identity.1 | 2 ++
src/identity/gnunet-identity.c | 16 +++++++++++++++-
2 files changed, 17 insertions(+), 1 deletion(-)
diff --git a/doc/man/gnunet-identity.1 b/doc/man/gnunet-identity.1
index 4a8970cf5..e51bbc85d 100644
--- a/doc/man/gnunet-identity.1
+++ b/doc/man/gnunet-identity.1
@@ -63,6 +63,8 @@ Perform "set" operation with the respective ego or restrict
"display" operation
Print the help page.
.It d | \-display
Display all of our egos.
+.It q | \-quiet
+Be quiet, in particular outputs only the public key when listing egos.
.It v | \-verbose
Be verbose, in particular outputs the public key of freshly created egos.
.It m | \-monitor
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",
--
To stop receiving notification emails like this one, please contact
address@hidden