Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/torch/argcheck.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRonan Collobert <ronan@collobert.com>2016-01-28 04:43:11 +0300
committerRonan Collobert <ronan@collobert.com>2016-01-28 04:43:11 +0300
commit1f1a43685f6fba2f4e27b7e305ea68a4037747c1 (patch)
treeaa2b44efb3651882fc3f45f732de8d5cf9c831b7 /graph.lua
parente6d8fe4f63715601afc7f45eb7b1913dfc5f12f7 (diff)
improve usage message
Diffstat (limited to 'graph.lua')
-rw-r--r--graph.lua17
1 files changed, 4 insertions, 13 deletions
diff --git a/graph.lua b/graph.lua
index 94108a4..32e3a0c 100644
--- a/graph.lua
+++ b/graph.lua
@@ -1,10 +1,5 @@
local usage = require 'argcheck.usage'
local utils = require 'argcheck.utils'
-local env = require 'argcheck.env'
-local sdascii
-pcall(function()
- sdascii = require 'sundown.ascii'
- end)
local function argname2idx(rules, name)
for idx, rule in ipairs(rules) do
@@ -356,18 +351,14 @@ function ACN:usage(...)
function(self)
if self.rules and not history[self.rules] then
history[self.rules] = true
- table.insert(txt, usage(self.rules))
+ table.insert(txt, usage(true, self.rules))
end
- end)
- local args = {}
- for i=1,select('#', ...) do
- table.insert(args, string.format("**%s**", env.type(select(i, ...))))
- end
- local render = sdascii and sdascii.render or function(...) return ... end
+ end
+ )
return string.format(
"%s\n%s\n",
table.concat(txt, '\n\nor\n\n'),
- sdascii.render(string.format("*Got:* %s", table.concat(args, ', ')))
+ usage(false, self, ...)
)
end