build: Changing the way version is managed
Now control over the version number is moved to wscript. In addition to
that, a new NDN_CXX_VERSION_BUILD_STRING macro is set to include more
detailed information, including commit ID (e.g., "0.1.0-rc1-1-g5c86570").
Change-Id: I89ddd4e2f1248bca4f828865ec6d3c3921fa2822
diff --git a/tools/ndnsec.cpp b/tools/ndnsec.cpp
index 1c62981..1e72ac0 100644
--- a/tools/ndnsec.cpp
+++ b/tools/ndnsec.cpp
@@ -12,6 +12,7 @@
* @author Yingdi Yu <http://irl.cs.ucla.edu/~yingdi/>
*/
+#include "version.hpp"
#include "ndnsec-util.hpp"
#include "ndnsec-list.hpp"
#include "ndnsec-get-default.hpp"
@@ -34,6 +35,7 @@
std::string ndnsec_helper("\
help Show all commands.\n\
+ version Show version and exit.\n\
list Display information in PublicInfo.\n\
get-default Get default setting info.\n\
set-default Configure default setting.\n\
@@ -64,7 +66,9 @@
try
{
- if (command == "help") { std::cerr << ndnsec_helper << std::endl; }
+ if (command == "help") { std::cout << ndnsec_helper << std::endl; }
+ else if (command == "version") { std::cout << NDN_CXX_VERSION_BUILD_STRING
+ << std::endl; }
else if (command == "list") { return ndnsec_list(argc - 1, argv + 1); }
else if (command == "get-default") { return ndnsec_get_default(argc - 1, argv + 1); }
else if (command == "set-default") { return ndnsec_set_default(argc - 1, argv + 1); }