From: Wolfgang Denk Date: Wed, 15 Sep 2010 21:18:44 +0200 Subject: [U-Boot] [PATCH 2/2] tools/env: fail on invalid options In-Reply-To: <1284572787-9842-2-git-send-email-daniel.hobi@schmid-telecom.ch> References: <1284572787-9842-1-git-send-email-daniel.hobi@schmid-telecom.ch> <1284572787-9842-2-git-send-email-daniel.hobi@schmid-telecom.ch> Message-ID: <20100915191844.E31D815242D@gemini.denx.de> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Dear Daniel Hobi, In message <1284572787-9842-2-git-send-email-daniel.hobi@schmid-telecom.ch> you wrote: > > Signed-off-by: Daniel Hobi > --- > 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_