add default operation when no argument is given
authorMatthias Wachs <wachs@net.in.tum.de>
Wed, 10 Jul 2013 10:24:28 +0000 (10:24 +0000)
committerMatthias Wachs <wachs@net.in.tum.de>
Wed, 10 Jul 2013 10:24:28 +0000 (10:24 +0000)
src/peerinfo-tool/gnunet-peerinfo.c

index 74ee1726fb7d50635d7f7cc28a7a50c0a80e9efd..34262aa6d0c98031ac9d5d3ecf0efd604ca41a35 100644 (file)
@@ -711,7 +711,7 @@ state_machine (void *cls,
     put_uri = NULL;
     return;
   }
-  if (GNUNET_YES == get_info)
+  else if (GNUNET_YES == get_info)
   {
     get_info = GNUNET_NO;
     GPI_plugins_load (cfg);
@@ -720,7 +720,7 @@ state_machine (void *cls,
                                   &print_peer_info, NULL);
     return;
   }
-  if (GNUNET_YES == get_self)
+  else if (GNUNET_YES == get_self)
   {
     struct GNUNET_CRYPTO_HashAsciiEncoded enc;
 
@@ -731,7 +731,7 @@ state_machine (void *cls,
     else
       printf (_("I am peer `%s'.\n"), (const char *) &enc);
   }
-  if (GNUNET_YES == get_uri)
+  else if (GNUNET_YES == get_uri)
   {
     GPI_plugins_load (cfg);
     pic = GNUNET_PEERINFO_iterate (peerinfo, include_friend_only, &my_peer_identity,
@@ -739,12 +739,21 @@ state_machine (void *cls,
     get_uri = GNUNET_NO;
     return;
   }
-  if (NULL != dump_hello)
+  else if (NULL != dump_hello)
   {
     pic = GNUNET_PEERINFO_iterate (peerinfo, include_friend_only, &my_peer_identity,
                                   TIMEOUT, &dump_my_hello, NULL);
     return;
   }
+  else
+  {
+       /* default operation list all */
+       get_info = GNUNET_YES;
+       tt = GNUNET_SCHEDULER_add_now (&state_machine, NULL);
+       return;
+  }
+
+
   GNUNET_SCHEDULER_shutdown ();
 }