From 46d9f8f827c8f797ae7d0fbfa3392e50d75a6006 Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Thu, 8 Aug 2013 21:40:39 +0000 Subject: -working on identity service create/rename/delete --- doc/man/gnunet-identity.1 | 6 +++--- src/identity/gnunet-identity.c | 12 +++++++----- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/doc/man/gnunet-identity.1 b/doc/man/gnunet-identity.1 index 6c48c8e2a..be6714cda 100644 --- a/doc/man/gnunet-identity.1 +++ b/doc/man/gnunet-identity.1 @@ -25,12 +25,12 @@ Delete the ego with the given NAME. Print help page. .TP -\fB\-L\fR, \fB\-\-list\fR -list all ouf our egos +\fB\-d\fR, \fB\-\-display\fR +display all ouf our egos .TP \fB\-m\fR, \fB\-\-monitor\fR -run in monitor mode, listing all ouf our egos until CTRL-C is pressed +run in monitor mode, listing all ouf our egos until CTRL-C is pressed. Each ego is listed together with a unique pointer value; if egos are renamed, that pointer value remains the same; if egos are deleted, they are listed one more time with a name of "". .SH FILES diff --git a/src/identity/gnunet-identity.c b/src/identity/gnunet-identity.c index 6981b3709..e56a05807 100644 --- a/src/identity/gnunet-identity.c +++ b/src/identity/gnunet-identity.c @@ -176,8 +176,7 @@ print_ego (void *cls, struct GNUNET_IDENTITY_Ego *ego, void **ctx, const char *identifier) -{ - +{ if (! (list | monitor)) return; if ( (NULL == ego) && (! monitor) ) @@ -185,7 +184,10 @@ print_ego (void *cls, GNUNET_SCHEDULER_shutdown (); return; } - fprintf (stderr, "%s\n", identifier); + if (monitor) + fprintf (stderr, "%s - %p\n", identifier, ego); + else if (NULL != identifier) + fprintf (stderr, "%s\n", identifier); } @@ -237,8 +239,8 @@ main (int argc, char *const *argv) {'D', "delete", "NAME", gettext_noop ("delete ego NAME "), 1, &GNUNET_GETOPT_set_string, &delete_ego}, - {'L', "list", NULL, - gettext_noop ("list all egos"), + {'d', "display", NULL, + gettext_noop ("display all egos"), 0, &GNUNET_GETOPT_set_one, &list}, {'m', "monitor", NULL, gettext_noop ("run in monitor mode egos"), -- cgit v1.2.3