2014-01-06 19:49:30 +04:00
2014-01-01 17:00:15 +04:00
2014-01-06 15:51:21 +04:00
2014-01-06 15:51:21 +04:00
2013-12-30 18:48:14 +04:00
2014-01-06 19:49:30 +04:00
2013-12-30 06:26:42 -08:00
2014-01-06 15:51:21 +04:00

largparse

Feature-rich command line parser for Lua inspired by argparse for Python.

WIP.

Something already works:


local largparse = require "largparse"

local parser = largparse.parser()

parser:argument("input", {
   args = 2
})

parser:mutually_exclusive(
   parser:flag("-q", "--quiet"),
   parser:option("-s", "--server")
)

local run = parser:command "run"

run:flag("-f", "--fast")

local args = parser:parse()

TODO L1

  • More tests
  • Add converters
  • Improve error messages: delegate them to parser, have separate methods for each error type

TODO L2

  • Add choices
  • Make interface declarative
  • Refactor Parser
  • Write primitive ugly usage and help message generation

TODO L3

  • Tests with 100% coverage
  • Document with LuaDoc/LDoc
  • Add examples
  • Add suggestions for command errors(e.g. $ luarocks isntall -> Did you mean 'install'?)
  • Add pretty formatted usage and help messages
  • Set up travis-ci testing

TODO L4

  • Release
Description
Feature-rich command line parser for Lua
Readme MIT 774 KiB
Languages
Lua 94.7%
Python 5.3%