diff --git a/tools/nfdc/execute-command.hpp b/tools/nfdc/execute-command.hpp
index 31b2d52..c8ea5d2 100644
--- a/tools/nfdc/execute-command.hpp
+++ b/tools/nfdc/execute-command.hpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /**
- * Copyright (c) 2014-2016,  Regents of the University of California,
+ * Copyright (c) 2014-2017,  Regents of the University of California,
  *                           Arizona Board of Regents,
  *                           Colorado State University,
  *                           University Pierre & Marie Curie, Sorbonne University,
@@ -45,15 +45,18 @@
   const std::string& verb;
   const CommandArguments& args;
 
+  int exitCode; ///< program exit code
+  std::ostream& out; ///< output stream
+  std::ostream& err; ///< error stream
+
   Face& face;
   KeyChain& keyChain;
   ///\todo validator
 };
 
 /** \brief a function to execute a command
- *  \return exit code
  */
-typedef std::function<int(ExecuteContext& ctx)> ExecuteCommand;
+typedef std::function<void(ExecuteContext& ctx)> ExecuteCommand;
 
 } // namespace nfdc
 } // namespace tools
diff --git a/tools/nfdc/help.cpp b/tools/nfdc/help.cpp
index 6088607..902bf67 100644
--- a/tools/nfdc/help.cpp
+++ b/tools/nfdc/help.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /**
- * Copyright (c) 2014-2016,  Regents of the University of California,
+ * Copyright (c) 2014-2017,  Regents of the University of California,
  *                           Arizona Board of Regents,
  *                           Colorado State University,
  *                           University Pierre & Marie Curie, Sorbonne University,
@@ -63,28 +63,27 @@
   os << "\nSee 'nfdc help <command>' to read about a specific subcommand.\n";
 }
 
-static int
+static void
 helpSingle(const std::string& noun, const std::string& verb)
 {
   std::string manpage = "nfdc-" + noun;
 
   execlp("man", "man", manpage.data(), nullptr);
   NDN_LOG_FATAL("Error opening man page for " << manpage);
-  return 1;
 }
 
-int
-help(ExecuteContext& ctx, const CommandParser& parser, std::ostream& os)
+void
+help(ExecuteContext& ctx, const CommandParser& parser)
 {
   std::string noun = ctx.args.get<std::string>("noun", "");
   std::string verb = ctx.args.get<std::string>("verb", "");
 
   if (noun.empty()) {
-    helpList(os, parser, ParseMode::ONE_SHOT, noun);
-    return 0;
+    helpList(ctx.out, parser, ParseMode::ONE_SHOT, noun);
   }
   else {
-    return helpSingle(noun, verb);
+    helpSingle(noun, verb); // should not return
+    ctx.exitCode = 1;
   }
 }
 
@@ -96,7 +95,7 @@
     .setTitle("display help information")
     .addArg("noun", ArgValueType::STRING, Required::NO, Positional::YES)
     .addArg("verb", ArgValueType::STRING, Required::NO, Positional::YES);
-  parser.addCommand(defHelp, bind(&help, _1, cref(parser), ref(std::cout)));
+  parser.addCommand(defHelp, bind(&help, _1, cref(parser)));
 }
 
 } // namespace nfdc
diff --git a/tools/nfdc/help.hpp b/tools/nfdc/help.hpp
index 4fd2dc5..07fce90 100644
--- a/tools/nfdc/help.hpp
+++ b/tools/nfdc/help.hpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /**
- * Copyright (c) 2014-2016,  Regents of the University of California,
+ * Copyright (c) 2014-2017,  Regents of the University of California,
  *                           Arizona Board of Regents,
  *                           Colorado State University,
  *                           University Pierre & Marie Curie, Sorbonne University,
@@ -38,8 +38,8 @@
 
 /** \brief the 'help' command
  */
-int
-help(ExecuteContext& ctx, const CommandParser& parser, std::ostream& os);
+void
+help(ExecuteContext& ctx, const CommandParser& parser);
 
 /** \brief registers 'help' command
  */
diff --git a/tools/nfdc/legacy-nfdc.cpp b/tools/nfdc/legacy-nfdc.cpp
index 467789e..86d9ad5 100644
--- a/tools/nfdc/legacy-nfdc.cpp
+++ b/tools/nfdc/legacy-nfdc.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /**
- * Copyright (c) 2014-2016,  Regents of the University of California,
+ * Copyright (c) 2014-2017,  Regents of the University of California,
  *                           Arizona Board of Regents,
  *                           Colorado State University,
  *                           University Pierre & Marie Curie, Sorbonne University,
@@ -325,7 +325,7 @@
     << std::endl;
 }
 
-int
+void
 legacyNfdcMain(ExecuteContext& ctx)
 {
   LegacyNfdc p(ctx.face, ctx.keyChain);
@@ -357,7 +357,8 @@
   catch (const po::error& e) {
     std::cerr << e.what() << std::endl;
     legacyNfdcUsage();
-    return 2;
+    ctx.exitCode = 2;
+    return;
   }
 
   if (wantUnsetChildInherit) {
@@ -378,17 +379,18 @@
       [] (const std::string& s) { return s.empty() || s[0] == '-'; })) {
     // unrecognized -option
     legacyNfdcUsage();
-    return 2;
+    ctx.exitCode = 2;
+    return;
   }
   p.m_commandLineArguments = unparsed;
 
   bool isOk = p.dispatch(subcommand);
   if (!isOk) {
     legacyNfdcUsage();
-    return 2;
+    ctx.exitCode = 2;
+    return;
   }
   ctx.face.processEvents();
-  return 0;
 }
 
 } // namespace nfdc
diff --git a/tools/nfdc/legacy-nfdc.hpp b/tools/nfdc/legacy-nfdc.hpp
index 9acb228..43e82c0 100644
--- a/tools/nfdc/legacy-nfdc.hpp
+++ b/tools/nfdc/legacy-nfdc.hpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /**
- * Copyright (c) 2014-2016,  Regents of the University of California,
+ * Copyright (c) 2014-2017,  Regents of the University of California,
  *                           Arizona Board of Regents,
  *                           Colorado State University,
  *                           University Pierre & Marie Curie, Sorbonne University,
@@ -173,7 +173,7 @@
 void
 legacyNfdcUsage();
 
-int
+void
 legacyNfdcMain(ExecuteContext& ctx);
 
 } // namespace nfdc
diff --git a/tools/nfdc/legacy-status.cpp b/tools/nfdc/legacy-status.cpp
index 5eaa581..a61defd 100644
--- a/tools/nfdc/legacy-status.cpp
+++ b/tools/nfdc/legacy-status.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /**
- * Copyright (c) 2014-2016,  Regents of the University of California,
+ * Copyright (c) 2014-2017,  Regents of the University of California,
  *                           Arizona Board of Regents,
  *                           Colorado State University,
  *                           University Pierre & Marie Curie, Sorbonne University,
@@ -45,7 +45,7 @@
  *          otherwise, caller should immediately exit with the specified exit code
  */
 static std::tuple<int, StatusReportOptions>
-parseCommandLine(const std::vector<std::string>& args)
+parseCommandLine(ExecuteContext& ctx, const std::vector<std::string>& args)
 {
   StatusReportOptions options;
 
@@ -67,17 +67,17 @@
     po::notify(vm);
   }
   catch (const po::error& e) {
-    std::cerr << e.what() << "\n";
-    showUsage(std::cerr, cmdOptions);
+    ctx.err << e.what() << "\n";
+    showUsage(ctx.err, cmdOptions);
     return std::make_tuple(2, options);
   }
 
   if (vm.count("help") > 0) {
-    showUsage(std::cout, cmdOptions);
+    showUsage(ctx.out, cmdOptions);
     return std::make_tuple(0, options);
   }
   if (vm.count("version") > 0) {
-    std::cout << "nfd-status " << NFD_VERSION_BUILD_STRING << "\n";
+    ctx.out << "nfd-status " << NFD_VERSION_BUILD_STRING << "\n";
     return std::make_tuple(0, options);
   }
 
@@ -96,19 +96,20 @@
 
 /** \brief the 'legacy-nfd-status' command
  */
-static int
+static void
 legacyNfdStatus(ExecuteContext& ctx)
 {
   auto args = ctx.args.get<std::vector<std::string>>("args");
 
   int exitCode = -1;
   StatusReportOptions options;
-  std::tie(exitCode, options) = parseCommandLine(args);
+  std::tie(exitCode, options) = parseCommandLine(ctx, args);
   if (exitCode >= 0) {
-    return exitCode;
+    ctx.exitCode = exitCode;
+    return;
   }
 
-  return reportStatus(ctx, options);
+  reportStatus(ctx, options);
 }
 
 void
diff --git a/tools/nfdc/main.cpp b/tools/nfdc/main.cpp
index da403c8..1f96c83 100644
--- a/tools/nfdc/main.cpp
+++ b/tools/nfdc/main.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /**
- * Copyright (c) 2014-2016,  Regents of the University of California,
+ * Copyright (c) 2014-2017,  Regents of the University of California,
  *                           Arizona Board of Regents,
  *                           Colorado State University,
  *                           University Pierre & Marie Curie, Sorbonne University,
@@ -63,8 +63,9 @@
   try {
     ndn::Face face;
     ndn::KeyChain keyChain;
-    ExecuteContext ctx{noun, verb, ca, face, keyChain};
-    return execute(ctx);
+    ExecuteContext ctx{noun, verb, ca, 0, std::cout, std::cerr, face, keyChain};
+    execute(ctx);
+    return ctx.exitCode;
   }
   catch (const std::exception& e) {
     std::cerr << e.what() << std::endl;
diff --git a/tools/nfdc/status.cpp b/tools/nfdc/status.cpp
index c14faa3..e7de814 100644
--- a/tools/nfdc/status.cpp
+++ b/tools/nfdc/status.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /**
- * Copyright (c) 2014-2016,  Regents of the University of California,
+ * Copyright (c) 2014-2017,  Regents of the University of California,
  *                           Arizona Board of Regents,
  *                           Colorado State University,
  *                           University Pierre & Marie Curie, Sorbonne University,
@@ -37,7 +37,7 @@
 namespace tools {
 namespace nfdc {
 
-int
+void
 reportStatus(ExecuteContext& ctx, const StatusReportOptions& options)
 {
   unique_ptr<Validator> validator = make_unique<ndn::ValidatorNull>();
@@ -75,46 +75,45 @@
 
   uint32_t code = report.collect(ctx.face, ctx.keyChain, *validator, ctrlOptions);
   if (code != 0) {
+    ctx.exitCode = 1;
     // Give a simple error code for end user.
     // Technical support personnel:
     // 1. get the exact command from end user
     // 2. code div 1000000 is zero-based section index
     // 3. code mod 1000000 is a Controller.fetch error code
-    std::cerr << "Error while collecting status report (" << code << ").\n";
-    return 1;
+    ctx.err << "Error while collecting status report (" << code << ").\n";
   }
 
   switch (options.output) {
     case ReportFormat::XML:
-      report.formatXml(std::cout);
+      report.formatXml(ctx.out);
       break;
     case ReportFormat::TEXT:
-      report.formatText(std::cout);
+      report.formatText(ctx.out);
       break;
   }
-  return 0;
 }
 
 /** \brief single-section status command
  */
-static int
+static void
 reportStatusSingleSection(ExecuteContext& ctx, bool StatusReportOptions::*wantSection)
 {
   StatusReportOptions options;
   options.*wantSection = true;
-  return reportStatus(ctx, options);
+  reportStatus(ctx, options);
 }
 
 /** \brief the 'status report' command
  */
-static int
+static void
 reportStatusComprehensive(ExecuteContext& ctx)
 {
   StatusReportOptions options;
   options.output = ctx.args.get<ReportFormat>("format", ReportFormat::TEXT);
   options.wantForwarderGeneral = options.wantChannels = options.wantFaces =
     options.wantFib = options.wantRib = options.wantStrategyChoice = true;
-  return reportStatus(ctx, options);
+  reportStatus(ctx, options);
 }
 
 void
diff --git a/tools/nfdc/status.hpp b/tools/nfdc/status.hpp
index 57d0eb8..6cc799e 100644
--- a/tools/nfdc/status.hpp
+++ b/tools/nfdc/status.hpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /**
- * Copyright (c) 2014-2016,  Regents of the University of California,
+ * Copyright (c) 2014-2017,  Regents of the University of California,
  *                           Arizona Board of Regents,
  *                           Colorado State University,
  *                           University Pierre & Marie Curie, Sorbonne University,
@@ -46,7 +46,7 @@
 
 /** \brief collect a status report and write to stdout
  */
-int
+void
 reportStatus(ExecuteContext& ctx, const StatusReportOptions& options);
 
 /** \brief registers status commands
