summaryrefslogtreecommitdiffstats
path: root/common
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2012-08-01 17:49:27 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2012-08-01 17:49:27 +0200
commitbff2e864952623dff55a27f022c3159206971852 (patch)
tree3656b5065668a804caaec333d9a4341d3a427f97 /common
parente986897cd0fdeae46ec0933d0acc7c5d5efa4008 (diff)
parent63b3a393092ccb3a162f378cb9d89414525a3a81 (diff)
downloadbarebox-bff2e864952623dff55a27f022c3159206971852.tar.gz
barebox-bff2e864952623dff55a27f022c3159206971852.tar.xz
Merge branch 'for-next/defenv-2'
Diffstat (limited to 'common')
-rw-r--r--common/Kconfig1
-rw-r--r--common/hush.c5
2 files changed, 5 insertions, 1 deletions
diff --git a/common/Kconfig b/common/Kconfig
index b776031bad..763983e7d5 100644
--- a/common/Kconfig
+++ b/common/Kconfig
@@ -508,6 +508,7 @@ config DEFAULT_ENVIRONMENT_GENERIC_NEW
select GLOB_SORT
select CMD_GLOBAL
select CMD_AUTOMOUNT
+ select CMD_BASENAME
select FLEXIBLE_BOOTARGS
prompt "Generic environment template"
diff --git a/common/hush.c b/common/hush.c
index 3ac1d10195..8200931387 100644
--- a/common/hush.c
+++ b/common/hush.c
@@ -521,6 +521,8 @@ static int builtin_getopt(struct p_context *ctx, struct child_prog *child,
o->optarg = xstrdup(optarg);
list_add_tail(&o->list, &ctx->options);
}
+ ctx->global_argv += optind - 1;
+ ctx->global_argc -= optind - 1;
}
ctx->options_parsed = 1;
@@ -1899,7 +1901,8 @@ static const __maybe_unused char cmd_getopt_help[] =
"hush option parser. <optstring> is a string with valid options. Add\n"
"a colon to an options if this option has a required argument or two\n"
"colons for an optional argument. The current option is saved in <var>,\n"
-"arguments are saved in OPTARG.\n";
+"arguments are saved in OPTARG. After this command additional nonopts\n"
+"can be accessed starting from $1\n";
BAREBOX_CMD_START(getopt)
.cmd = do_getopt,