fix
[oweals/gnunet.git] / src / fs / gnunet-directory.c
index de4ccdd3fbd7eb24e60ab169e901eeb8d8e57f74..1b17f69d24dc2f99f2100b58aa15d42bfa462960 100644 (file)
@@ -84,6 +84,15 @@ print_entry (void *cls,
 {
   char *string;
 
+  if (uri == NULL)
+    {
+      printf (_("Directory summary:\n"));
+      GNUNET_CONTAINER_meta_data_iterate (meta,
+                                         &item_printer,
+                                         NULL);
+      printf ("\n");
+      return;
+    }
   string = GNUNET_FS_uri_to_string (uri);
   printf ("%s:\n", string);
   GNUNET_free (string);
@@ -157,14 +166,6 @@ run (void *cls,
     }
 }
 
-/**
- * gnunet-directory command line options
- */
-static struct GNUNET_GETOPT_CommandLineOption options[] = {
-  GNUNET_GETOPT_OPTION_END
-};
-
-
 /**
  * The main function to inspect GNUnet directories.
  *
@@ -175,6 +176,9 @@ static struct GNUNET_GETOPT_CommandLineOption options[] = {
 int
 main (int argc, char *const *argv)
 {
+  static struct GNUNET_GETOPT_CommandLineOption options[] = {
+    GNUNET_GETOPT_OPTION_END
+  };
   return (GNUNET_OK ==
           GNUNET_PROGRAM_run (argc,
                               argv,