refactor parallel code
This commit is contained in:
19
openos/unalias.lua
Normal file
19
openos/unalias.lua
Normal file
@@ -0,0 +1,19 @@
|
||||
local shell = require("shell")
|
||||
|
||||
local args = shell.parse(...)
|
||||
if #args < 1 then
|
||||
io.write("Usage: unalias <name>...\n")
|
||||
return 2
|
||||
end
|
||||
local e = 0
|
||||
|
||||
for _,arg in ipairs(args) do
|
||||
local result = shell.getAlias(arg)
|
||||
if not result then
|
||||
io.stderr:write(string.format("unalias: %s: not found\n", arg))
|
||||
e = 1
|
||||
else
|
||||
shell.setAlias(arg, nil)
|
||||
end
|
||||
end
|
||||
return e
|
||||
Reference in New Issue
Block a user