[U-Boot] [PATCH] Fix --noheader on fw_printenv

Alex Kiernan alex.kiernan at gmail.com
Thu Feb 8 09:35:25 UTC 2018


Using fw_printenv with --noheader fails:

  root at nrr-922:~# fw_printenv --noheader arch
  ## Error: `-n' option requires exactly one argument

Whereas -n works:

  root at nrr-922:~# fw_printenv -n arch
  arm

The single argument it's expecting isn't taken from getopt parsing,
but instead from the remaining argv arguments.

Signed-off-by: Alex Kiernan <alex.kiernan at gmail.com>
---

 tools/env/fw_env_main.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/env/fw_env_main.c b/tools/env/fw_env_main.c
index 6fdf41c..d93a915 100644
--- a/tools/env/fw_env_main.c
+++ b/tools/env/fw_env_main.c
@@ -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}
-- 
2.7.4



More information about the U-Boot mailing list