Skip to contentSkip to conversation

Fix --noheader on fw_printenv

PATCH New Alex Kiernan 2 participants 2 messages Feb 11, 2018 – Feb 15, 2018

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 Fix --noheader on fw_printenv

The single argument `--noheader' is expecting isn't taken from getopt parsing, but instead from the remaining argv arguments.

---

Changes in v2:
- Simplified commit message, improved error message

 tools/env/fw_env.c      | 2 +-
 tools/env/fw_env_main.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
tools/env/fw_env.c +1 -1
index ca5507d..6b71acb 100644
@@ -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;
 	}
 
tools/env/fw_env_main.c +1 -1
index 6fdf41c..d93a915 100644
@@ -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}
Signature · 1 line
2.7.4
#1 lore raw

PATCH v2 1/1 Fix --noheader on fw_printenv

Quoted 4 lines · Alex Kiernan

The single argument `--noheader' is expecting isn't taken from getopt parsing, but instead from the remaining argv arguments.

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20180215/a526096a/attachment.sig>