poke: exit with status 5 if prefix registration fails

Change-Id: I2147570c37146011c9a4e8c024b74bcafdf18e4e
diff --git a/tools/peek/ndnpeek/main.cpp b/tools/peek/ndnpeek/main.cpp
index f763b96..ead3d70 100644
--- a/tools/peek/ndnpeek/main.cpp
+++ b/tools/peek/ndnpeek/main.cpp
@@ -150,7 +150,7 @@
     program.start();
     face.processEvents();
 
-    return static_cast<int>(program.getResultCode());
+    return static_cast<int>(program.getResult());
   }
   catch (const std::exception& e) {
     std::cerr << "ERROR: " << e.what() << std::endl;
diff --git a/tools/peek/ndnpeek/ndnpeek.cpp b/tools/peek/ndnpeek/ndnpeek.cpp
index 8ce23f6..8969216 100644
--- a/tools/peek/ndnpeek/ndnpeek.cpp
+++ b/tools/peek/ndnpeek/ndnpeek.cpp
@@ -79,7 +79,7 @@
 void
 NdnPeek::onData(const Data& data)
 {
-  m_resultCode = ResultCode::DATA;
+  m_result = Result::DATA;
   m_timeoutEvent.cancel();
 
   if (m_options.isVerbose) {
@@ -101,7 +101,7 @@
 void
 NdnPeek::onNack(const lp::Nack& nack)
 {
-  m_resultCode = ResultCode::NACK;
+  m_result = Result::NACK;
   m_timeoutEvent.cancel();
 
   lp::NackHeader header = nack.getHeader();
@@ -123,7 +123,7 @@
 void
 NdnPeek::onTimeout()
 {
-  m_resultCode = ResultCode::TIMEOUT;
+  m_result = Result::TIMEOUT;
   m_timeoutEvent.cancel();
 
   if (m_options.isVerbose) {
diff --git a/tools/peek/ndnpeek/ndnpeek.hpp b/tools/peek/ndnpeek/ndnpeek.hpp
index a544b37..0a9f503 100644
--- a/tools/peek/ndnpeek/ndnpeek.hpp
+++ b/tools/peek/ndnpeek/ndnpeek.hpp
@@ -55,25 +55,26 @@
   optional<time::milliseconds> timeout;
 };
 
-enum class ResultCode {
-  UNKNOWN = 1,
-  DATA = 0,
-  NACK = 4,
-  TIMEOUT = 3,
-};
-
 class NdnPeek : boost::noncopyable
 {
 public:
   NdnPeek(Face& face, const PeekOptions& options);
 
+  enum class Result {
+    DATA = 0,
+    UNKNOWN = 1,
+    // 2 is reserved for "malformed command line"
+    TIMEOUT = 3,
+    NACK = 4,
+  };
+
   /**
    * @return the result of NdnPeek execution
    */
-  ResultCode
-  getResultCode() const
+  Result
+  getResult() const
   {
-    return m_resultCode;
+    return m_result;
   }
 
   /**
@@ -112,7 +113,7 @@
   time::steady_clock::TimePoint m_sendTime;
   ScopedPendingInterestHandle m_pendingInterest;
   scheduler::ScopedEventId m_timeoutEvent;
-  ResultCode m_resultCode = ResultCode::UNKNOWN;
+  Result m_result = Result::UNKNOWN;
 };
 
 } // namespace peek