summaryrefslogtreecommitdiffstats
path: root/commands/magicvar.c
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2011-11-26 21:33:59 +0100
committerSascha Hauer <s.hauer@pengutronix.de>2011-11-29 20:51:31 +0100
commit020a30be0d9a3b56a98c4e4094d13d3b4e3bd4eb (patch)
tree58705c8fbff18a82690e25a34778f063054adf03 /commands/magicvar.c
parent6fa8c93a5ecefe4effa0e0425441a8ff6b2ce6ab (diff)
downloadbarebox-020a30be0d9a3b56a98c4e4094d13d3b4e3bd4eb.tar.gz
add magicvar command
The magicvar command gives an overview about all environment variables with a special meaning. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'commands/magicvar.c')
-rw-r--r--commands/magicvar.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/commands/magicvar.c b/commands/magicvar.c
new file mode 100644
index 0000000..31606d2
--- /dev/null
+++ b/commands/magicvar.c
@@ -0,0 +1,20 @@
+#include <common.h>
+#include <command.h>
+#include <magicvar.h>
+
+static int do_magicvar(struct command *cmdtp, int argc, char *argv[])
+{
+ struct magicvar *m;
+
+ for (m = &__barebox_magicvar_start;
+ m != &__barebox_magicvar_end;
+ m++)
+ printf("%-32s %s\n", m->name, m->description);
+
+ return 0;
+}
+
+BAREBOX_CMD_START(magicvar)
+ .cmd = do_magicvar,
+ .usage = "List information about magic variables",
+BAREBOX_CMD_END