mirror of https://github.com/Hilbis/Hilbish
fix: correct no files check to compensate for pipes
parent
003100d3c4
commit
8fabdf4502
|
@ -102,23 +102,23 @@ commander.register('greenhouse', function(args, sinks)
|
||||||
gh:addPage(page)
|
gh:addPage(page)
|
||||||
end
|
end
|
||||||
|
|
||||||
if #args ~= 0 then
|
|
||||||
for _, name in ipairs(args) do
|
for _, name in ipairs(args) do
|
||||||
local f <close> = io.open(name, 'r')
|
local f <close> = io.open(name, 'r')
|
||||||
if not f then
|
if not f then
|
||||||
sinks.err:writeln(string.format('could not open file %s', name))
|
sinks.err:writeln(string.format('could not open file %s', name))
|
||||||
end
|
end
|
||||||
|
|
||||||
local page = Page(name, f:read '*a')
|
local page = Page(name, f:read '*a')
|
||||||
gh:addPage(page)
|
gh:addPage(page)
|
||||||
end
|
end
|
||||||
ansikit.hideCursor()
|
|
||||||
gh:initUi()
|
if #gh.pages == 0 then
|
||||||
else
|
|
||||||
sinks.out:writeln [[greenhouse is the Hilbish pager library and command!
|
sinks.out:writeln [[greenhouse is the Hilbish pager library and command!
|
||||||
usage: greenhouse <file>...
|
usage: greenhouse <file>...
|
||||||
|
|
||||||
example: greenhouse hello.md]]
|
example: greenhouse hello.md]]
|
||||||
|
return 1
|
||||||
end
|
end
|
||||||
|
|
||||||
|
ansikit.hideCursor()
|
||||||
|
gh:initUi()
|
||||||
end)
|
end)
|
||||||
|
|
Loading…
Reference in New Issue