summaryrefslogtreecommitdiff
path: root/env/fw_env_main.c
diff options
context:
space:
mode:
authorTobias Klauser <tklauser@distanz.ch>2010-03-31 18:27:03 +0200
committerTobias Klauser <tklauser@distanz.ch>2010-03-31 18:27:03 +0200
commit9b67de66810c5bff9d69b69d01f96d4d3be12bca (patch)
tree9b4f42176c8cb20fe3c9ccffe14c21a650ed041c /env/fw_env_main.c
parent7a185defac8b19f82a2c6a57e57efe28940623a3 (diff)
u-boot-tools: Implement fw_getenv for console usage
Diffstat (limited to 'env/fw_env_main.c')
-rw-r--r--env/fw_env_main.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/env/fw_env_main.c b/env/fw_env_main.c
index 7f631c4..3e022ed 100644
--- a/env/fw_env_main.c
+++ b/env/fw_env_main.c
@@ -46,6 +46,7 @@
#define CMD_PRINTENV "fw_printenv"
#define CMD_SETENV "fw_setenv"
+#define CMD_GETENV "fw_getenv"
int
main(int argc, char *argv[])
@@ -71,6 +72,19 @@ main(int argc, char *argv[])
return (EXIT_SUCCESS);
+ } else if (strcmp(cmdname, CMD_GETENV) == 0) {
+
+ if (argc > 1) {
+ while (--argc) {
+ char *val = fw_getenv(argv[argc]);
+
+ if (val)
+ printf("%s\n", val);
+ else
+ fprintf(stderr, "%s: no such variable in environment\n", argv[argc]);
+ }
+ }
+ return (EXIT_SUCCESS);
}
fprintf (stderr,