summaryrefslogtreecommitdiffstats
path: root/common/env.c
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2007-07-05 18:01:52 +0200
committerSascha Hauer <sha@octopus.labnet.pengutronix.de>2007-07-05 18:01:52 +0200
commite694adc6a4716fc589693eb8eb8e67bbf54e8edc (patch)
treef8af4d37d05c8f628ecc3abbe8c8d48a43794482 /common/env.c
parent2692aaeb76f66cc8fe2f1196697d9a75b06c4522 (diff)
downloadbarebox-e694adc6a4716fc589693eb8eb8e67bbf54e8edc.tar.gz
svn_rev_420
- do more POSIX: - use DIR instead of struct dirent - use (struct dirent)->d_name instead of (struct dirent)->name - switch to a new layout for U_BOOT_CMD: - use C99 initializers to be able to add more fields to the command struct - add aliases for commands (needed mainly for help -> ? and test -> [ - This is not done for all commands yet, but the compiler will tell you ;)
Diffstat (limited to 'common/env.c')
-rw-r--r--common/env.c23
1 files changed, 14 insertions, 9 deletions
diff --git a/common/env.c b/common/env.c
index 5d9f8ff..7d5a021 100644
--- a/common/env.c
+++ b/common/env.c
@@ -126,13 +126,15 @@ int do_printenv (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
return 0;
}
-U_BOOT_CMD(
- printenv, CONFIG_MAXARGS, 1, do_printenv,
- "printenv- print environment variables\n",
+U_BOOT_CMD_START(printenv)
+ .maxargs = CONFIG_MAXARGS,
+ .cmd = do_printenv,
+ .usage = "printenv- print environment variables\n",
+ U_BOOT_CMD_HELP(
"\n - print values of all environment variables\n"
"printenv name ...\n"
- " - print value of environment variable 'name'\n"
-);
+ " - print value of environment variable 'name'\n")
+U_BOOT_CMD_END
#ifdef CONFIG_SIMPLE_PARSER
int do_setenv ( cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
@@ -147,13 +149,16 @@ int do_setenv ( cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
return 0;
}
-U_BOOT_CMD(
- setenv, CONFIG_MAXARGS, 0, do_setenv,
- "setenv - set environment variables\n",
+U_BOOT_CMD_START(setenv)
+ .maxargs = CONFIG_MAXARGS,
+ .cmd = do_setenv,
+ .usage = "setenv - set environment variables\n",
+ U_BOOT_CMD_HELP(
"name value ...\n"
" - set environment variable 'name' to 'value ...'\n"
"setenv name\n"
" - delete environment variable 'name'\n"
-);
+U_BOOT_CMD_END
+
#endif