core: unify version string

refs #2671

Change-Id: I88a58a500a43635cc8698c4bf444723d6e713590
diff --git a/tools/ping/ndn-ping-server.cpp b/tools/ping/ndn-ping-server.cpp
index d508e6c..437c529 100644
--- a/tools/ping/ndn-ping-server.cpp
+++ b/tools/ping/ndn-ping-server.cpp
@@ -35,12 +35,7 @@
  * @author: Jerald Paul Abraham <jeraldabraham@email.arizona.edu>
  */
 
-#include <ndn-cxx/face.hpp>
-#include <ndn-cxx/name.hpp>
-#include <ndn-cxx/security/key-chain.hpp>
-
-#include <boost/asio.hpp>
-#include <boost/noncopyable.hpp>
+#include "core/version.hpp"
 
 namespace ndn {
 namespace ping {
@@ -209,7 +204,7 @@
   int res;
 
   NdnPingServer program(argv[0]);
-  while ((res = getopt(argc, argv, "hdtp:x:")) != -1)
+  while ((res = getopt(argc, argv, "hdtp:x:V")) != -1)
     {
       switch (res) {
       case 'h':
@@ -224,7 +219,10 @@
       case 't':
         program.setPrintTimestamp();
         break;
-      default:
+      case 'V':
+        std::cout << "ndnpingserver " << tools::VERSION << std::endl;
+        return 0;
+     default:
         program.usage();
         break;
       }
diff --git a/tools/ping/ndn-ping.cpp b/tools/ping/ndn-ping.cpp
index 11591a6..5d0908e 100644
--- a/tools/ping/ndn-ping.cpp
+++ b/tools/ping/ndn-ping.cpp
@@ -35,13 +35,9 @@
  * @author: Jerald Paul Abraham <jeraldabraham@email.arizona.edu>
  */
 
-#include <ndn-cxx/face.hpp>
-#include <ndn-cxx/name.hpp>
+#include "core/version.hpp"
 
-#include <boost/asio.hpp>
-#include <boost/bind.hpp>
 #include <boost/date_time/posix_time/posix_time.hpp>
-#include <boost/noncopyable.hpp>
 
 namespace ndn {
 namespace ping {
@@ -389,7 +385,7 @@
   int res;
 
   NdnPing program(argv[0]);
-  while ((res = getopt(argc, argv, "htai:c:n:p:")) != -1)
+  while ((res = getopt(argc, argv, "htai:c:n:p:V")) != -1)
     {
       switch (res) {
       case 'a':
@@ -418,6 +414,9 @@
       case 't':
         program.setPrintTimestamp();
         break;
+      case 'V':
+        std::cout << "ndnping " << tools::VERSION << std::endl;
+        return 0;
       default:
         program.usage();
         break;