lua-users home
lua-l archive

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

Miles Bader <> writes:
> 1) It parses all options and returns a table; why is it called "getopt"
>   (which implies that it returns a single option)?
> 2) Only allowing "--foo=bar" syntax, and not "--foo bar" syntax, is
>   likely to surprise users.  Instead of having the options argument be
>   a string, why not make it a table containing an entry for each option
>   name that takes an arg?  Then long-options could be specified too.
> 3) The behavior of skipping "option-like" (beginning with "-") values
>   when searching for an option's argument may seem clever, but is not
>   compatible with traditional practice, and seems likely to frustrate
>   users.  It seems better to just be simple and use the next available
>   value for an option's argument, whether or not it starts with "-".
> 4) Some weird results:
>     test_opts({"--opt", "oink", "--other", "-a", "foo", "-c", "baz"}, "ab")
>     [a]        <oink>
>     [opt]      <true>
>     [c]        <true>
>     [other]    <true>
>   Notice A's value...

I talked to someone who is a regular LKML poster and also pointed out to me that the notation -LBlah wouldn't work as it does with ls. Thanks for the feedback.