summaryrefslogtreecommitdiffstats
path: root/arch/sandbox
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2010-09-22 16:01:07 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2010-09-22 16:01:07 +0200
commit9b7aede404775d3a6cc678c3d36d430684508672 (patch)
tree5c3fa85a4e9711c423ecb16a41c0e87db0d8ded4 /arch/sandbox
parentb41f4ffdac21f2c53b33e100d2471489a1205ab7 (diff)
parent038163e9df3d3ee5bf27de42978554b8313e7524 (diff)
downloadbarebox-9b7aede404775d3a6cc678c3d36d430684508672.tar.gz
barebox-9b7aede404775d3a6cc678c3d36d430684508672.tar.xz
Merge branch 'for-mainline' of git://git.pengutronix.de/git/rsc/barebox into next
Diffstat (limited to 'arch/sandbox')
-rw-r--r--arch/sandbox/os/common.c46
1 files changed, 32 insertions, 14 deletions
diff --git a/arch/sandbox/os/common.c b/arch/sandbox/os/common.c
index acfa35e035..c73aa79f2e 100644
--- a/arch/sandbox/os/common.c
+++ b/arch/sandbox/os/common.c
@@ -1,3 +1,4 @@
+
/*
* common.c - common wrapper functions between barebox and the host
*
@@ -296,7 +297,23 @@ int main(int argc, char *argv[])
}
mem_malloc_init(ram, ram + malloc_size);
- while ((opt = getopt(argc, argv, "hi:e:I:O:")) != -1) {
+ while (1) {
+ int option_index = 0;
+ static struct option long_options[] = {
+ {"help", 0, 0, 'h'},
+ {"image", 1, 0, 'i'},
+ {"env", 1, 0, 'e'},
+ {"stdout", 1, 0, 'O'},
+ {"stdin", 1, 0, 'I'},
+ {0, 0, 0, 0},
+ };
+
+ opt = getopt_long(argc, argv, "hi:e:O:I:",
+ long_options, &option_index);
+
+ if (opt == -1)
+ break;
+
switch (opt) {
case 'h':
print_usage(basename(argv[0]));
@@ -363,19 +380,20 @@ static void print_usage(const char *prgname)
{
printf(
"Usage: %s [OPTIONS]\n"
-"Start barebox.\n"
-"Options:\n"
-" -i <file> Map a file to barebox. This option can be given multiple\n"
-" times. The files will show up as /dev/fd0 ... /dev/fdx\n"
-" under barebox.\n"
-" -e <file> Map a file to barebox. With this option files are mapped as\n"
-" /dev/env0 ... /dev/envx and thus are used as default\n"
-" environment. An empty file generated with dd will do to get\n"
-" started wth an empty environment\n"
-" -O <file> Register file as a console capable of doing stdout. File can\n"
-" be a regular file or a fifo.\n"
-" -I <file> Register file as a console capable of doing stdin. File can\n"
-" be a regular file or a fifo.\n",
+"Start barebox.\n\n"
+"Options:\n\n"
+" -i, --image=<file> Map an image file to barebox. This option can be given\n"
+" multiple times. The files will show up as\n"
+" /dev/fd0 ... /dev/fdx under barebox.\n"
+" -e, --env=<file> Map a file with an environment to barebox. With this \n"
+" option, files are mapped as /dev/env0 ... /dev/envx\n"
+" and thus are used as the default environment.\n"
+" An empty file generated with dd will do to get started\n"
+" with an empty environment.\n"
+" -O, --stdout=<file> Register a file as a console capable of doing stdout.\n"
+" <file> can be a regular file or a FIFO.\n"
+" -I, --stdin=<file> Register a file as a console capable of doing stdin.\n"
+" <file> can be a regular file or a FIFO.\n",
prgname
);
}