diff options
Diffstat (limited to 'client/cmd.cpp')
-rw-r--r-- | client/cmd.cpp | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/client/cmd.cpp b/client/cmd.cpp index 99a4dd6..0a73dad 100644 --- a/client/cmd.cpp +++ b/client/cmd.cpp @@ -1,3 +1,4 @@ +#include <cstdio> #include <cstdlib> #include <string.h> @@ -13,3 +14,19 @@ void cmd_test(char*) { i2c_send(0x39, (char*) data, strlen(data)); } +void cmd_help(char*) { + printf("List of available commands:\n"); + for (size_t i = 0; i < cmds_length; i++) { + struct cmd cmd = cmds[i]; + printf(" %-*s", 10, cmd.name); + if (cmd.info != NULL) + printf(" %s", cmd.info); + printf("\n"); + } + + printf( + "\n" + "You can also use the TAB key to autocomplete commands\n" + ); +} + |