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

stefan at agner.ch stefan at agner.ch
Thu Feb 8 15:37:18 UTC 2018


On 08.02.2018 10:35, Alex Kiernan wrote:
> Using fw_printenv with --noheader fails:
> 
>   root at nrr-922:~# fw_printenv --noheader arch
>   ## Error: `-n' option requires exactly one argument

I think it would work with --noheader=arch

> 
> 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.

That makes sense. But the commit log text above is kind of unrelated/not
relevant, I would just use this two lines as git message.

--
Stefan

> 
> 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}


More information about the U-Boot mailing list