Add version command. (#237)

This commit is contained in:
Jonathan Hui
2016-07-04 10:12:25 -07:00
committed by GitHub
parent 0dc1a6a321
commit 0abde2e2cc
3 changed files with 20 additions and 0 deletions
+8
View File
@@ -36,6 +36,7 @@
#include <string.h>
#include <openthread.h>
#include <openthread-config.h>
#include "cli.hpp"
#include <common/encoding.hpp>
@@ -79,6 +80,7 @@ const struct Command Interpreter::sCommands[] =
{ "start", &ProcessStart },
{ "state", &ProcessState },
{ "stop", &ProcessStop },
{ "version", &ProcessVersion },
{ "whitelist", &ProcessWhitelist },
};
@@ -1267,6 +1269,12 @@ exit:
AppendResult(error);
}
void Interpreter::ProcessVersion(int argc, char *argv[])
{
sServer->OutputFormat("%s\r\n", PACKAGE_NAME "/" PACKAGE_VERSION "; " __DATE__ " " __TIME__);
AppendResult(kThreadError_None);
}
void Interpreter::ProcessWhitelist(int argc, char *argv[])
{
ThreadError error = kThreadError_None;