env: allow to export only selected variables

New syntax:
	env export [-t | -b | -c] [-s size] addr [var ...]

With this change it is possible to provide a list of variables names
that shall be exported.  Whenno arguments are given, the whole
environment gets exported.

NOTE: The new handling of the "size" argument means a change to the
user API.

Signed-off-by: Wolfgang Denk <wd@denx.de>
This commit is contained in:
Wolfgang Denk
2011-11-06 22:49:44 +01:00
parent 5721385b18
commit 37f2fe7472
11 changed files with 47 additions and 26 deletions

View File

@ -68,7 +68,7 @@ int saveenv(void)
char *res;
res = (char *)&env_new.data;
len = hexport_r(&env_htab, '\0', &res, ENV_SIZE);
len = hexport_r(&env_htab, '\0', &res, ENV_SIZE, 0, NULL);
if (len < 0) {
error("Cannot export environment: errno = %d\n", errno);
return 1;