Skip to content

Commit

Permalink
Update argparse
Browse files Browse the repository at this point in the history
  • Loading branch information
mpeterv committed Oct 31, 2015
1 parent 058fe3d commit ae2eb0e
Show file tree
Hide file tree
Showing 3 changed files with 499 additions and 375 deletions.
10 changes: 3 additions & 7 deletions install.lua
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,15 @@ local has_argparse, argparse = pcall(require, "luacheck.argparse")
assert(has_argparse, "couldn't find argparse module")
local lua_executable = assert(arg[-1], "couldn't detect Lua executable")

local parser = argparse "<lua> install.lua"
:description ("Luacheck " .. luacheck._VERSION .. " installer.")
local parser = argparse("<lua> install.lua", "Luacheck " .. luacheck._VERSION .. " installer.")

parser:argument "path"
:description (([[
parser:argument("path", ([[
Installation path.
Luacheck executable scripts will be installed into <path>%sbin.
Luacheck modules will be installed into <path>%ssrc.
Pass . to build luacheck executable script without installing.]]):format(dirsep, dirsep))

parser:option "--lua"
:description "Absolute path to lua interpreter or its name if it's in PATH."
:default(lua_executable)
parser:option("--lua", "Absolute path to lua interpreter or its name if it's in PATH.", lua_executable)

local args = parser:parse()

Expand Down
Loading

0 comments on commit ae2eb0e

Please sign in to comment.