Skip to content

Commit

Permalink
Merge pull request Kong#1608 from Mashape/fix/drop-cli-trace
Browse files Browse the repository at this point in the history
fix(cli) drop the --trace option as it provides little information.
  • Loading branch information
thibaultcha authored Sep 8, 2016
2 parents d223adb + 4e0d053 commit 40c295e
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions kong/cmd/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ local meta = require "kong.meta"
local options = [[
--v verbose
--vv debug
--trace with traceback
]]

local cmds_arr = {}
Expand Down Expand Up @@ -76,7 +75,6 @@ return function(args)
log.set_lvl(log.levels.verbose)
elseif args.vv then
log.set_lvl(log.levels.debug)
args.trace = true
end

log.verbose("Kong: %s", meta._VERSION)
Expand All @@ -85,10 +83,10 @@ return function(args)
log.debug("Lua: %s", jit and jit.version or _VERSION)

xpcall(function() cmd_exec(args) end, function(err)
if not args.trace then
if not (args.v or args.vv) then
err = err:match "^.-:.-:.(.*)$"
io.stderr:write("Error: "..err.."\n")
io.stderr:write("\n Run with --trace to see traceback\n")
io.stderr:write("\n Run with --v (verbose) or --vv (debug) for more details\n")
else
local trace = debug.traceback(err, 2)
io.stderr:write("Error: \n")
Expand Down

0 comments on commit 40c295e

Please sign in to comment.