lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


On Thu, Jan 11, 2007 at 08:43:54AM -0200, Luiz Henrique de Figueiredo wrote:
> > Is it just me that would expect some kind of version and (c) info when 
> > running `lua --version'?
> 
> It's just you :-) lua does not support GNU-like long options, sorry.
> Try lua -v.

For what it's worth, it's not just him.  --version is unambiguous; no
sensible application would have it do anything but what you'd expect,
but -v very often means "verbose", so I always try --version first.
It seems fundamental these days to me.  Patch attached, if anyone
wants it.

-- 
Glenn Maynard
--- lua.c~	2007-01-11 06:31:25.412683276 -0500
+++ lua.c	2007-01-11 06:36:45.297029161 -0500
@@ -263,6 +263,10 @@
         return i;
     switch (argv[i][1]) {  /* option */
       case '-':
+        if (strcmp(argv[i], "--version") == 0) {
+          *pv = 1;
+          break;
+        }
         notail(argv[i]);
         return (argv[i+1] != NULL ? i+1 : 0);
       case '\0':