tools: nfdc face create command

refs #3864

Change-Id: Icca589eceae0b78f68cda61e761dd4721ce54f9c
diff --git a/tools/nfdc/execute-command.cpp b/tools/nfdc/execute-command.cpp
index 639fd19..4dd4f24 100644
--- a/tools/nfdc/execute-command.cpp
+++ b/tools/nfdc/execute-command.cpp
@@ -29,6 +29,28 @@
 namespace tools {
 namespace nfdc {
 
+time::nanoseconds
+ExecuteContext::getTimeout() const
+{
+  return time::seconds(4);
+}
+
+ndn::nfd::CommandOptions
+ExecuteContext::makeCommandOptions() const
+{
+  return ndn::nfd::CommandOptions()
+           .setTimeout(time::duration_cast<time::milliseconds>(this->getTimeout()));
+}
+
+Controller::CommandFailCallback
+ExecuteContext::makeCommandFailureHandler(const std::string& commandName)
+{
+  return [=] (const ndn::nfd::ControlResponse& resp) {
+    this->exitCode = 1;
+    this->err << "Error " << resp.getCode() << " when " << commandName << ": " << resp.getText() << '\n';
+  };
+}
+
 Controller::DatasetFailCallback
 ExecuteContext::makeDatasetFailureHandler(const std::string& datasetName)
 {