summaryrefslogtreecommitdiffstats
path: root/common/cmd_exec.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/cmd_exec.c
parent2692aaeb76f66cc8fe2f1196697d9a75b06c4522 (diff)
downloadbarebox-e694adc6a4716fc589693eb8eb8e67bbf54e8edc.tar.gz
barebox-e694adc6a4716fc589693eb8eb8e67bbf54e8edc.tar.xz
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/cmd_exec.c')
-rw-r--r--common/cmd_exec.c14
1 files changed, 6 insertions, 8 deletions
diff --git a/common/cmd_exec.c b/common/cmd_exec.c
index bbe5c5641c..78cbfd7035 100644
--- a/common/cmd_exec.c
+++ b/common/cmd_exec.c
@@ -44,7 +44,7 @@ out:
return NULL;
}
-int do_exec(cmd_tbl_t * cmdtp, int flag, int argc, char *argv[])
+static int do_exec(cmd_tbl_t * cmdtp, int flag, int argc, char *argv[])
{
int i;
char *script;
@@ -70,10 +70,8 @@ out:
return 1;
}
-int do_exec (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]);
-U_BOOT_CMD(
- exec, CONFIG_MAXARGS, 1, do_exec,
- "exec - execute a script\n",
- "<filename> - execute <filename>\n"
-);
-
+U_BOOT_CMD_START(exec)
+ .maxargs = CONFIG_MAXARGS,
+ .cmd = do_exec,
+ .usage = "exec <files> - execute a script\n",
+U_BOOT_CMD_END