mirror of
https://github.com/ShadowKatStudios/OC-Minitel.git
synced 2024-11-23 02:28:05 +11:00
exportfs does better arg parsing now, can export ro or rw
This commit is contained in:
parent
5679885592
commit
69815096fe
@ -1,17 +1,16 @@
|
|||||||
local fsproxy = require "fsproxy"
|
local fsproxy = require "fsproxy"
|
||||||
local rpc = require "rpc"
|
|
||||||
local fs = require "filesystem"
|
local fs = require "filesystem"
|
||||||
|
local shell = require "shell"
|
||||||
|
local rpc = require "rpc"
|
||||||
|
|
||||||
local tA = {...}
|
local tA, tO = shell.parse(...)
|
||||||
if #tA < 1 then
|
if #tA < 1 then
|
||||||
print("Usage: exportfs <directory> [directory] ...")
|
print("Usage: exportfs <directory> [--rw] [--name=<name>]")
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
local px = fsproxy.new(tA[1], not tO.rw)
|
||||||
for k,v in pairs(tA) do
|
local name = tO.name or tA[1]
|
||||||
local px = fsproxy.new(v)
|
for l,m in pairs(px) do
|
||||||
for l,m in pairs(px) do
|
rpc.register("fs_"..name.."_"..l,m)
|
||||||
rpc.register("fs_"..v.."_"..l,m)
|
|
||||||
end
|
|
||||||
print(v)
|
|
||||||
end
|
end
|
||||||
|
print(string.format("%s (%s)", name, (tO.rw and "rw") or "ro"))
|
||||||
|
@ -30,7 +30,7 @@ function fsproxy.new(path,wp) -- string boolean -- table -- Returns a proxy obje
|
|||||||
end
|
end
|
||||||
local handles = {}
|
local handles = {}
|
||||||
function proxy.isReadOnly()
|
function proxy.isReadOnly()
|
||||||
return originalProxy.isReadOnly()
|
return wp or originalProxy.isReadOnly()
|
||||||
end
|
end
|
||||||
function proxy.getLabel()
|
function proxy.getLabel()
|
||||||
return originalProxy.getLabel()
|
return originalProxy.getLabel()
|
||||||
|
Loading…
Reference in New Issue
Block a user