tools: add exit code and streams to nfdc::ExecuteContext

Moving exit code to the context allows error handling routines to
rely only on the context.

Moving stdout and stderr streams to the context allows mocking in
unit tests, and allows sending output to a buffer for pre-processing
when we implement interactive mode.

refs #3864

Change-Id: Ibf59c12405d0eaca0597835cb2e30125b7f70adb
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