mirror of https://github.com/Hilbis/Hilbish
Compare commits
3 Commits
0a01ed862c
...
52a58b14c3
Author | SHA1 | Date |
---|---|---|
TorchedSammy | 52a58b14c3 | |
TorchedSammy | 15035c02cb | |
Renzix | dd678a4a75 |
|
@ -1,8 +1,7 @@
|
||||||
A bit after creation, we have the outside nature. Little plants, seeds,
|
A bit after creation, we have the outside nature. Little plants, seeds,
|
||||||
growing to their final phase: a full plant. A lot of Hilbish itself is
|
growing to their final phase: a full plant. A lot of Hilbish itself is
|
||||||
written in Go, but there are parts made in Lua, being the `doc` command,
|
written in Go, but there are parts made in Lua, being most builtins
|
||||||
command not executable/found hooks to print a message in the shell,
|
(`doc`, `cd`, cdr), completions, and other things.
|
||||||
and other things.
|
|
||||||
|
|
||||||
Hilbish's Lua core module is called `nature`. It's handled after everything
|
Hilbish's Lua core module is called `nature`. It's handled after everything
|
||||||
on the Go side initializes, which is what that first sentence was from.
|
on the Go side initializes, which is what that first sentence was from.
|
||||||
|
|
|
@ -58,17 +58,19 @@ commander.register('doc', function(args)
|
||||||
local propstr = ''
|
local propstr = ''
|
||||||
local modDesc = ''
|
local modDesc = ''
|
||||||
local modmt = getmetatable(require(mod))
|
local modmt = getmetatable(require(mod))
|
||||||
modDesc = modmt.__doc
|
if modmt then
|
||||||
if modmt.__docProp then
|
modDesc = modmt.__doc
|
||||||
-- not all modules have docs for properties
|
if modmt.__docProp then
|
||||||
props = table.map(modmt.__docProp, function(v, k)
|
-- not all modules have docs for properties
|
||||||
return lunacolors.underline(lunacolors.blue(k)) .. ' > ' .. v
|
props = table.map(modmt.__docProp, function(v, k)
|
||||||
end)
|
return lunacolors.underline(lunacolors.blue(k)) .. ' > ' .. v
|
||||||
|
end)
|
||||||
|
end
|
||||||
|
if #props > 0 then
|
||||||
|
propstr = '\n# Properties\n' .. table.concat(props, '\n') .. '\n'
|
||||||
|
end
|
||||||
|
desc = string.format(modDocFormat, modDesc, propstr)
|
||||||
end
|
end
|
||||||
if #props > 0 then
|
|
||||||
propstr = '\n# Properties\n' .. table.concat(props, '\n') .. '\n'
|
|
||||||
end
|
|
||||||
desc = string.format(modDocFormat, modDesc, propstr)
|
|
||||||
end
|
end
|
||||||
print(desc .. formattedFuncs)
|
print(desc .. formattedFuncs)
|
||||||
f:close()
|
f:close()
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
local _ = require 'succulent' -- Function additions
|
local _ = require 'succulent' -- Function additions
|
||||||
|
|
||||||
package.path = package.path .. ';' .. hilbish.dataDir .. '/?/init.lua'
|
package.path = package.path .. ';' .. hilbish.dataDir .. '/?/init.lua'
|
||||||
.. ';' .. hilbish.dataDir .. '/?/?.lua'
|
.. ';' .. hilbish.dataDir .. '/?/?.lua' .. ";" .. hilbish.dataDir .. '/?.lua'
|
||||||
|
|
||||||
require 'nature.commands'
|
require 'nature.commands'
|
||||||
require 'nature.completions'
|
require 'nature.completions'
|
||||||
|
|
Loading…
Reference in New Issue