openOS command line programs

This commit is contained in:
kepler155c@gmail.com
2019-04-07 10:10:30 -04:00
parent 5f2f33f1f2
commit 8f2c97d269
20 changed files with 163 additions and 280 deletions

View File

@@ -1,6 +1,6 @@
local shell = require("shell")
local fs = require("filesystem")
local text = require("text")
local shell = require("openos.shell")
local fs = require("openos.filesystem")
local text = require("openos.text")
local args, options = shell.parse(...)
@@ -59,7 +59,7 @@ local function remove(path, ...)
return ec_bump()
else
local list, reason = fs.list(rpath)
if not list then
io.stderr:write(tostring(reason)..'\n')
return ec_bump()
@@ -88,7 +88,7 @@ for _,path in ipairs(args) do
local segments = {}
if options.p and path:len() > 1 and path:find('/') then
chain = text.split(path, {'/'}, true)
local chain = text.split(path, {'/'}, true)
local prefix = ''
for _,e in ipairs(chain) do
table.insert(segments, 1, prefix .. e)