summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFreeArtMan <dos21h@gmail.com>2017-05-07 16:48:29 +0100
committerFreeArtMan <dos21h@gmail.com>2017-05-07 16:48:29 +0100
commit77b33a254d698fb65f83fe3df0e0e7410a2c78d6 (patch)
tree627590fda35705312dc14a36c098e83210ceef24
parent417edbce2abde566e94d8986b487293d55e173c0 (diff)
downloadagni-77b33a254d698fb65f83fe3df0e0e7410a2c78d6.tar.gz
agni-77b33a254d698fb65f83fe3df0e0e7410a2c78d6.zip
Improved version command
-rw-r--r--cmd_version.c7
-rw-r--r--cmd_version.h4
-rw-r--r--version.h5
3 files changed, 15 insertions, 1 deletions
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