diff options
author | Ronan Collobert <ronan@collobert.com> | 2016-01-28 04:43:11 +0300 |
---|---|---|
committer | Ronan Collobert <ronan@collobert.com> | 2016-01-28 04:43:11 +0300 |
commit | 1f1a43685f6fba2f4e27b7e305ea68a4037747c1 (patch) | |
tree | aa2b44efb3651882fc3f45f732de8d5cf9c831b7 /graph.lua | |
parent | e6d8fe4f63715601afc7f45eb7b1913dfc5f12f7 (diff) |
improve usage message
Diffstat (limited to 'graph.lua')
-rw-r--r-- | graph.lua | 17 |
1 files changed, 4 insertions, 13 deletions
@@ -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 |