Skip to content

Commit

Permalink
Upgrade to argparse 0.6.0
Browse files Browse the repository at this point in the history
  • Loading branch information
mpeterv committed Apr 14, 2018
1 parent 8f55e2e commit 3b2805c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion depgraph-scm-1.rockspec
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ image using GraphViz. It can also detect circular and external dependencies.
}
dependencies = {
"lua >= 5.1, < 5.4",
"argparse >= 0.5.0",
"argparse >= 0.6.0",
"luafilesystem >= 1.6.3"
}
build = {
Expand Down
16 changes: 8 additions & 8 deletions src/depgraph/cli.lua
Original file line number Diff line number Diff line change
Expand Up @@ -12,19 +12,20 @@ local function main(argv)
local version = "depgraph v" .. depgraph._VERSION

local parser = argparse("luadepgraph", version .. ", dependency analyzer and visualizer for Lua packages.")
:help_max_width(80)
:help_description_margin(29)
:usage_margin(3)

parser:option("-m --modules", [[Add files, directories or rockspecs
to the graph as modules.]])
parser:option("-m --modules", "Add files, directories or rockspecs to the graph as modules.")
:args("*"):count("*"):action("concat"):argname("<path>")
parser:option("-e --ext-files", [[Add files or directories to the graph
as external files that can depend on modules.]])
parser:option("-e --ext-files", "Add files or directories to the graph as external files " ..
"that can depend on modules.")
:args("*"):count("*"):action("concat"):argname("<path>")
parser:option("-p --prefix", "Infer module names relatively to <prefix>.")

parser:mutex(
parser:flag("--list", "List all modules and external files. (default)"),
parser:option("--show", [[Show all information about a module
or an external file.]])
parser:option("--show", "Show all information about a module or an external file.")
:argname("<module>"),
parser:flag("--deps", "Show external dependencies of the graph."),
parser:flag("--cycles", "Show circular dependencies."),
Expand All @@ -33,8 +34,7 @@ or an external file.]])
)

parser:flag("--strict", "Ignore lazy dependencies.")
parser:option("--root", [[Select only dependencies of <root> module
or external file, recursively.]])
parser:option("--root", "Select only dependencies of <root> module or external file, recursively.")

parser:flag("-v --version", "Show version info and exit.")
:action(function() print(version) os.exit(0) end)
Expand Down

0 comments on commit 3b2805c

Please sign in to comment.