1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
|
local options = {{"abandon", "a", "bool", default = false, desc = "abandon your belief"},
{"bullshit", "b", "bool", default = false, desc = "start to bullshit"},
{"cheat", "c", "bool", default = false, desc = "try to cheat"},
{"delete", "d", "bool", default = false, desc = "remove everything"},
{"hehe", "h", "bool", default = false, desc = "233333"},
{"oh", "o", "bool", default = true, desc = "oh yes!"},
{"uid", nil, "int", desc = "user uid"},
{"str", nil, "string", desc = "test string"}}
args, opts = nerv.parse_args({"arg1", "arg2", "-abcd", "arg3",
"--hehe", "--oh=no", "--uid=43",
"highfive", "--str=hello"}, options)
nerv.print_usage(options)
print(table.tostring(args), table.tostring(opts))
|