mpeterv / argparse

Feature-rich command line parser for Lua
MIT License
251 stars 43 forks source link

Argument choices? #25

Closed VADemon closed 4 years ago

VADemon commented 4 years ago

I was going by the documentation and wanted to restrict a certain argument to only a few choices as described.

However it appears that there's no "choices" whatsoever in argparse.lua? CTRL+F for choices choice - 0 matches.

This leaves me no choice but to forget about this feature.

argparse = require("lib.argparse")

local parser = argparse("name", "descr", "footer")
parser:argument("-s --site")
    :choices{"auto","two","three"}
    :description("Type of link")

L4: attempt to call a nil value (method 'choices')

What happened there with the doc/lib?

p-ouellette commented 4 years ago

argparse is now maintained by luarocks: https://github.com/luarocks/argparse

VADemon commented 4 years ago

Thanks, since I can't change the title, I think it would be nice if you created an issue to notify people :)