summaryrefslogtreecommitdiff
path: root/shell.h
diff options
context:
space:
mode:
Diffstat (limited to 'shell.h')
-rw-r--r--shell.h26
1 files changed, 16 insertions, 10 deletions
diff --git a/shell.h b/shell.h
index f509880..54a3b7a 100644
--- a/shell.h
+++ b/shell.h
@@ -30,19 +30,25 @@
#define _SHELL_H
#include <stddef.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
-#include <error.h>
#include <macros.h>
-#define SHELL_REGISTER_CMDS(cmds) \
-MACRO_BEGIN \
- size_t ___i; \
- int ___error; \
- \
- for (___i = 0; ___i < ARRAY_SIZE(cmds); ___i++) { \
- ___error = shell_cmd_register(&(cmds)[___i]); \
- error_check(___error, __func__); \
- } \
+#define SHELL_REGISTER_CMDS(cmds) \
+MACRO_BEGIN \
+ size_t ___i; \
+ int ___error; \
+ \
+ for (___i = 0; ___i < ARRAY_SIZE(cmds); ___i++) { \
+ ___error = shell_cmd_register(&(cmds)[___i]); \
+ \
+ if (___error) { \
+ fprintf(stderr, "%s: %s\n", __func__, strerror(___error)); \
+ abort(); \
+ } \
+ } \
MACRO_END
typedef void (*shell_fn_t)(int argc, char *argv[]);