lua-users home
lua-l archive

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

 >> > wrote:
 >>  >>
 >>  >> doesn't look good too.
 >> > looks clean to me.  what's bad with this?
 >> 1) This code is not versioned. I'd prefer to use code
 >>    registered somewhere as a separate project, e.g. luaforge.
 >>    I'd like to package getopt for pkgsrc (

> Put it in a version control system, then >:)
No, thanks :-) This is not my code.
I just thought that such a basic module is already implemented
and widely accepted by LUA community.

 >> This code doesn't do what I need and is not compatible with SUS/POSIX.

> Where does POSIX define command line option parsing?

> Have you considered just writing a little C code to bind the C
> library's getopt?
It trivial to implement getopt_long in LUA. I did it for AWK some time
ago, ~150 lines of code. Also the problem with C code is that
getopt_long(3) is not available on Solaris/HP-UX and some
others. getopt_long(3) is not portable.

Best regards, Aleksey Cheusov.