lua

A copy of the Lua development repository
Log | Files | Refs | README

commit 094a7d0290bbbe248d9d29b28c2567283d5ad0ba
parent 7cc0e63d8a5bd45eabd328c398f02a933e07746d
Author: Roberto Ierusalimschy <roberto@inf.puc-rio.br>
Date:   Mon,  7 Feb 2011 10:26:49 -0200

detail in 'print_usage'

Diffstat:
Mlua.c | 10++++------
1 file changed, 4 insertions(+), 6 deletions(-)

diff --git a/lua.c b/lua.c @@ -1,5 +1,5 @@ /* -** $Id: lua.c,v 1.194 2010/10/25 19:01:37 roberto Exp roberto $ +** $Id: lua.c,v 1.195 2010/12/03 17:20:50 roberto Exp roberto $ ** Lua stand-alone interpreter ** See Copyright Notice in lua.h */ @@ -106,13 +106,11 @@ static void laction (int i) { static void print_usage (const char *badoption) { - if (badoption[1] == 'e' || badoption[1] == 'l') { - luai_writestringerror("%s: ", progname); + luai_writestringerror("%s: ", progname); + if (badoption[1] == 'e' || badoption[1] == 'l') luai_writestringerror("'%s' needs argument\n", badoption); - } else { - luai_writestringerror("%s: ", progname); + else luai_writestringerror("unrecognized option '%s'\n", badoption); - } luai_writestringerror( "usage: %s [options] [script [args]]\n" "Available options are:\n"