shellex: fix aliasing and colorize grep

This commit is contained in:
kepler155c@gmail.com
2019-05-13 09:30:27 -04:00
parent 9f3070bbdc
commit 180f0f9b93
5 changed files with 132 additions and 26 deletions

View File

@@ -1,6 +1,4 @@
local Config = require('config')
local kernel = _G.kernel
local fs = _G.fs
local os = _G.os
local settings = _G.settings
@@ -13,12 +11,7 @@ function os.getenv(k)
return settings.get(k)
end
local config = Config.load('shell', { aliases = { } })
if not config.openOsInit then
config.openOsInit = true
for _, alias in pairs({ 'ls', 'rm', 'cp', 'mv' }) do
config.aliases[alias] = nil
kernel.getShell().clearAlias(alias)
end
Config.update('shell', config)
end
fs.mount('rom/programs/list.lua', 'linkfs', 'packages/shellex/ls.lua')
fs.mount('rom/programs/delete.lua', 'linkfs', 'packages/shellex/rm.lua')
fs.mount('rom/programs/copy.lua', 'linkfs', 'packages/shellex/cp.lua')
fs.mount('rom/programs/move.lua', 'linkfs', 'packages/shellex/mv.lua')