summaryrefslogtreecommitdiffstats
path: root/common/hush.c
diff options
context:
space:
mode:
authorHolger Schurig <holgerschurig@gmail.com>2014-05-13 10:28:53 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2014-05-14 10:03:48 +0200
commit26a34100e88b707db00f0b66361f344177cdf4ff (patch)
treea2697e4300c94e39d43d8a80cf00a0332a83e254 /common/hush.c
parent6e3a969106fc84413f6ccef34fb78c0f8f9dd6ba (diff)
downloadbarebox-26a34100e88b707db00f0b66361f344177cdf4ff.tar.gz
commands: HUSH_GETOPT -> CMD_GETOPT
* this compile option actually turns on a command, so name it accordingly * also move the Kconfig definition into commands/Kconfig, thus placing getopt into the "Shell scripting commands" section * while at it, improve Kconfig documention Signed-off-by: Holger Schurig <holgerschurig@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'common/hush.c')
-rw-r--r--common/hush.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/common/hush.c b/common/hush.c
index 92f9576..09239cd 100644
--- a/common/hush.c
+++ b/common/hush.c
@@ -533,7 +533,7 @@ static void setup_string_in_str(struct in_str *i, const char *s)
i->p = s;
}
-#ifdef CONFIG_HUSH_GETOPT
+#ifdef CONFIG_CMD_GETOPT
static int builtin_getopt(struct p_context *ctx, struct child_prog *child,
int argc, char *argv[])
{
@@ -823,7 +823,7 @@ static int run_pipe_real(struct p_context *ctx, struct pipe *pi)
remove_quotes(globbuf.gl_pathc, globbuf.gl_pathv);
if (!strcmp(globbuf.gl_pathv[0], "getopt") &&
- IS_ENABLED(CONFIG_HUSH_GETOPT)) {
+ IS_ENABLED(CONFIG_CMD_GETOPT)) {
ret = builtin_getopt(ctx, child, globbuf.gl_pathc, globbuf.gl_pathv);
} else if (!strcmp(globbuf.gl_pathv[0], "exit")) {
ret = builtin_exit(ctx, child, globbuf.gl_pathc, globbuf.gl_pathv);
@@ -1154,7 +1154,7 @@ static void initialize_context(struct p_context *ctx)
static void release_context(struct p_context *ctx)
{
-#ifdef CONFIG_HUSH_GETOPT
+#ifdef CONFIG_CMD_GETOPT
struct option *opt, *tmp;
list_for_each_entry_safe(opt, tmp, &ctx->options, list) {
@@ -2000,7 +2000,7 @@ BAREBOX_CMD_START(exit)
BAREBOX_CMD_HELP(cmd_exit_help)
BAREBOX_CMD_END
-#ifdef CONFIG_HUSH_GETOPT
+#ifdef CONFIG_CMD_GETOPT
BAREBOX_CMD_HELP_START(getopt)
BAREBOX_CMD_HELP_TEXT("OPTSTRING contains the option letters. Add a colon to an options if this")
BAREBOX_CMD_HELP_TEXT("option has a required argument or two colons for an optional argument. The")