From 77b33a254d698fb65f83fe3df0e0e7410a2c78d6 Mon Sep 17 00:00:00 2001 From: FreeArtMan Date: Sun, 7 May 2017 16:48:29 +0100 Subject: Improved version command --- cmd_version.c | 7 ++++++- cmd_version.h | 4 ++++ version.h | 5 +++++ 3 files changed, 15 insertions(+), 1 deletion(-) create mode 100644 version.h diff --git a/cmd_version.c b/cmd_version.c index a2190ab..d919c60 100644 --- a/cmd_version.c +++ b/cmd_version.c @@ -5,7 +5,12 @@ void *cmd_version(void *data) char *param = (char *)data; char *ret = NULL; + const int buf_size = 128; + char buf[buf_size+1]; + printf("VERSION\n"); - ret = alloc_new_str("v0.0.1\n"); + snprintf(buf, buf_size, "VERSION:0.0.3" " DATE:" VERSION_DATE " COMMIT:" VERSION_COMMIT "\n"); + + ret = alloc_new_str(buf); } \ No newline at end of file diff --git a/cmd_version.h b/cmd_version.h index ede27bb..23cd639 100644 --- a/cmd_version.h +++ b/cmd_version.h @@ -6,6 +6,10 @@ #include "util.h" + +//Auto generated in Makefile +#include "version.h" + void *cmd_version(void *data); #endif diff --git a/version.h b/version.h new file mode 100644 index 0000000..b5a65ab --- /dev/null +++ b/version.h @@ -0,0 +1,5 @@ +#ifndef __VERSION_H +#define __VERSION_H +#define VERSION_DATE "Sun May 7 16:28:02 BST 2017" +#define VERSION_COMMIT "417edbc Added new commands CMD,SHA1. Added support of params for commands. Fixed some bugs with uninitialised buffers" +#endif -- cgit v1.2.3