]> git.ipfire.org Git - u-boot.git/commitdiff
Fix --noheader on fw_printenv
authorAlex Kiernan <alex.kiernan@gmail.com>
Sun, 11 Feb 2018 17:16:46 +0000 (17:16 +0000)
committerTom Rini <trini@konsulko.com>
Wed, 14 Feb 2018 17:14:15 +0000 (12:14 -0500)
The single argument `--noheader' is expecting isn't taken from getopt
parsing, but instead from the remaining argv arguments.

Signed-off-by: Alex Kiernan <alex.kiernan@gmail.com>
tools/env/fw_env.c
tools/env/fw_env_main.c

index ca5507d4d7315ab9a8b4a4f104f64ff92ba151d6..6b71acb28fe1c47451e84e80ef31bb5fd7867436 100644 (file)
@@ -452,7 +452,7 @@ int fw_printenv(int argc, char *argv[], int value_only, struct env_opts *opts)
 
        if (value_only && argc != 1) {
                fprintf(stderr,
-                       "## Error: `-n' option requires exactly one argument\n");
+                       "## Error: `-n'/`--noheader' option requires exactly one argument\n");
                return -1;
        }
 
index 6fdf41c8760422b27fd381b4ba56473f5a6fce4e..d93a915fd142827e2259cd78b260565e4c4e76e6 100644 (file)
@@ -46,7 +46,7 @@ static struct option long_options[] = {
        {"config", required_argument, NULL, 'c'},
        {"help", no_argument, NULL, 'h'},
        {"script", required_argument, NULL, 's'},
-       {"noheader", required_argument, NULL, 'n'},
+       {"noheader", no_argument, NULL, 'n'},
        {"lock", required_argument, NULL, 'l'},
        {"version", no_argument, NULL, 'v'},
        {NULL, 0, NULL, 0}