]> git.kernelconcepts.de Git - karo-tx-uboot.git/commitdiff
tools/env: allow option "-n" for fw_printenv
authorDaniel Hobi <daniel.hobi@schmid-telecom.ch>
Wed, 15 Sep 2010 17:46:26 +0000 (19:46 +0200)
committerWolfgang Denk <wd@denx.de>
Sat, 18 Sep 2010 21:56:02 +0000 (23:56 +0200)
In commit bd7b26f8 (Tools: set multiple variable with fw_setenv utility),
the option parsing was changed to getopt_long(3), but option "-n"
of fw_printenv was not included.

This leads to an error message "invalid option -- 'n'" on stderr,
although the output on stdout is correct.

Signed-off-by: Daniel Hobi <daniel.hobi@schmid-telecom.ch>
tools/env/fw_env_main.c

index 82116b4b2917d1dfb796e7c6f98e8ff95301eccd..baf3a4d90906dc9c76bb92cac82938fac564f5bc 100644 (file)
@@ -59,7 +59,7 @@ void usage(void)
 
        fprintf(stderr, "fw_printenv/fw_setenv, "
                "a command line interface to U-Boot environment\n\n"
-               "usage:\tfw_printenv\n"
+               "usage:\tfw_printenv [-n] [variable name]\n"
                "\tfw_setenv [variable name] [variable value]\n"
                "\tfw_setenv -s [ file ]\n"
                "\tfw_setenv -s - < [ file ]\n\n"
@@ -93,9 +93,12 @@ main(int argc, char *argv[])
                cmdname = p + 1;
        }
 
-       while ((c = getopt_long (argc, argv, "s:h",
+       while ((c = getopt_long (argc, argv, "ns:h",
                long_options, NULL)) != EOF) {
                switch (c) {
+               case 'n':
+                       /* handled in fw_printenv */
+                       break;
                case 's':
                        script_file = optarg;
                        break;