[U-Boot] [PATCH 2/2] tools/env: fail on invalid options

Wolfgang Denk wd at denx.de
Wed Sep 15 21:18:44 CEST 2010


Dear Daniel Hobi,

In message <1284572787-9842-2-git-send-email-daniel.hobi at schmid-telecom.ch> you wrote:
> 
> Signed-off-by: Daniel Hobi <daniel.hobi at schmid-telecom.ch>
> ---
>  tools/env/fw_env_main.c |    2 ++
>  1 files changed, 2 insertions(+), 0 deletions(-)
> 
> diff --git a/tools/env/fw_env_main.c b/tools/env/fw_env_main.c
> index baf3a4d..381ed14 100644
> --- a/tools/env/fw_env_main.c
> +++ b/tools/env/fw_env_main.c
> @@ -105,6 +105,8 @@ main(int argc, char *argv[])
>  		case 'h':
>  			usage();
>  			return EXIT_SUCCESS;
> +		default: /* '?' */
> +			return EXIT_FAILURE;

This should print an error message before returning; for example, run
usage() as in the 'h' case - just with different return code.

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
He had quite a powerful intellect, but it  was  as  powerful  like  a
locomotive,  and  ran on rails and was therefore almost impossible to
steer.                          - Terry Pratchett, _Lords and Ladies_


More information about the U-Boot mailing list