summaryrefslogtreecommitdiffstats
path: root/commands/setenv.c
diff options
context:
space:
mode:
authorAhmad Fatoum <a.fatoum@pengutronix.de>2020-09-15 14:08:31 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2020-09-18 11:01:19 +0200
commit932481a005cc7b2933791a349a312af0149b6c94 (patch)
treef2ad8701e842a301c97cffcfa0c40539aa42c0d9 /commands/setenv.c
parentfbf145dc86832846465a317619dd4d61af3897b3 (diff)
downloadbarebox-932481a005cc7b2933791a349a312af0149b6c94.tar.gz
barebox-932481a005cc7b2933791a349a312af0149b6c94.tar.xz
commands: setenv: allow use with hush shell
setenv was so far restricted to the simple shell, because with hush, users could just do dev.var=VAL for setting variables in the environment. The hush syntax doesn't allow for setting all kinds of environment variables though, e.g. 5c00a000.tamp@5c00a000:reboot-mode.of.param can't be set with hush, because of the special characters. It could still be read by using the ${variable} syntax though. Allow setting these variables by making the setenv command generally available. The default is chosen to be 'y', because the command is deemed small and useful enough to have it there by default. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'commands/setenv.c')
-rw-r--r--commands/setenv.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/commands/setenv.c b/commands/setenv.c
index a70a0de4ce..ad26770655 100644
--- a/commands/setenv.c
+++ b/commands/setenv.c
@@ -5,6 +5,7 @@
#include <command.h>
#include <errno.h>
#include <environment.h>
+#include <complete.h>
static int do_setenv(int argc, char *argv[])
{
@@ -34,5 +35,6 @@ BAREBOX_CMD_START(setenv)
BAREBOX_CMD_DESC("set environment variable")
BAREBOX_CMD_OPTS("NAME [VALUE]")
BAREBOX_CMD_GROUP(CMD_GRP_ENV)
+ BAREBOX_CMD_COMPLETE(env_param_noeval_complete)
BAREBOX_CMD_HELP(cmd_setenv_help)
BAREBOX_CMD_END