mirror of https://github.com/Hilbis/Hilbish
feat: add command.not-found hook
parent
a655ff00ce
commit
14e6ae5a3c
|
@ -1,10 +1,10 @@
|
|||
-- The preload file initializes everything else for our shell
|
||||
-- Currently it just adds our builtins
|
||||
|
||||
local fs = require 'fs'
|
||||
local commander = require 'commander'
|
||||
local bait = require 'bait'
|
||||
|
||||
-- Builtins
|
||||
commander.register('cd', function (args)
|
||||
bait.throw('cd', args)
|
||||
if #args > 0 then
|
||||
|
@ -86,3 +86,8 @@ function string.split(str, delimiter)
|
|||
return result
|
||||
end
|
||||
|
||||
-- Hook handles
|
||||
bait.catch('command.not-found', function(cmd)
|
||||
print(string.format('hilbish: %s not found', cmd))
|
||||
end)
|
||||
|
||||
|
|
Loading…
Reference in New Issue