shell: implement version command

tags/0.1.0
S.J.R. van Schaik 7 years ago
parent 149281f694
commit 6570ab27c9
  1. 2
      Makefile
  2. 3
      include/shell/version.h
  3. 15
      source/shell/version.c

@ -12,6 +12,7 @@ all: $(BUILD)/tbm
-include scripts/Makefile.${TARGET}
CFLAGS += -DTBM_VERSION=\"2017-07-27-dev\"
CFLAGS += -Iinclude
CFLAGS += -Wall -Wundef -Wextra -Wshadow -Wimplicit-function-declaration
CFLAGS += -Wredundant-decls -Wmissing-prototypes -Wstrict-prototypes -pedantic
@ -47,6 +48,7 @@ obj-y += source/shell/flash.o
obj-y += source/shell/ftl.o
obj-y += source/shell/mufs.o
obj-y += source/shell/rtc.o
obj-y += source/shell/version.o
obj = $(addprefix $(BUILD)/, $(obj-y))

@ -0,0 +1,3 @@
#pragma once
void shell_version(struct console *con, const char **argv, size_t argc);

@ -0,0 +1,15 @@
#include <stdio.h>
#include <console.h>
#include <shell/version.h>
void shell_version(struct console *con, const char **argv, size_t argc)
{
(void)argv;
if (argc < 1)
return;
fprintf(con->fp, "hello,%s\n", TBM_VERSION);
}
Loading…
Cancel
Save