From 4c9c0ef276cbeb849f46d12f866e9b3868815bf2 Mon Sep 17 00:00:00 2001 From: Tobias Ulmer Date: Fri, 22 Nov 2013 12:33:30 +0100 Subject: [PATCH] e2option: showtoolmanpage() does return, handle return code correctly Signed-off-by: Tobias Ulmer --- generic/e2option.lua | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/generic/e2option.lua b/generic/e2option.lua index 2b1f08e..6052fd6 100644 --- a/generic/e2option.lua +++ b/generic/e2option.lua @@ -194,7 +194,7 @@ local function defaultoptions() e2lib.abort(re) end - e2lib.finish(0) + e2lib.finish(rc) end, category) @@ -416,8 +416,9 @@ function e2option.usage(rc) e2lib.finish(rc) end ---- Show the manpage of the current tool and exit the process. --- @return This function does not return. +--- Show the manpage for the current tool +-- @return Return code of man viewer, or false on error. +-- @return Error object on failure. function e2option.showtoolmanpage() local tool = toolname() local mpage = e2lib.join('man', 'man1', string.format('%s.1', tool)) @@ -481,9 +482,9 @@ function e2option.showtoolmanpage() table.insert(cmd, e2lib.shquote(mpage)) - os.execute(table.concat(cmd, ' ')) + local rc = os.execute(table.concat(cmd, ' ')) - return true + return rc/256 -- XXX: os.execute end return strict.lock(e2option) -- 2.39.5