Files
argparse/spec/script
2014-02-17 18:41:09 +04:00

36 lines
724 B
Lua
Executable File

#!/usr/bin/env lua
local Parser = require "argparse"
local parser = Parser "test"
:description "A testing program. "
parser:argument "input"
parser:flag "-v" "--verbose"
:description "Sets verbosity level. "
:target "verbosity"
:count "0-2"
local install = parser:command "install"
:description "Install a rock. "
install:argument "rock"
:description "Name of the rock. "
install:argument "version"
:description "Version of the rock. "
:args "?"
install:option "-f" "--from"
:description "Fetch the rock from this server. "
:target "server"
local args = parser:parse()
print(args.input)
print(args.verbosity)
print(args.install)
print(args.rock)
print(args.version)
print(args.server)