local fs=require("filesystem") local shell=require("shell") local function usage() io.stderr:write([==[ Usage: mount [OPTIONS] [device] [path]") If no args are given, all current mount points are printed. Note that multiple options can be used together -r, --ro Mount the filesystem read only --bind Create a mount bind point, folder to folder device Specify filesystem device by one of: a. label b. address (can be abbreviated) c. folder path (requires --bind) path Target folder path to mount to See `man mount` for more details ]==]) os.exit(1) end local args,opts=shell.parse(...) opts.readonly=opts.r or opts.readonly if opts.h or opts.help then usage() end local function print_mounts() local mounts={} for proxy,path in fs.mounts()do local device={} device.dev_path=proxy.address device.mount_path=path device.rw_ro=proxy.isReadOnly()and"ro"or"rw" device.fs_label=proxy.getLabel()or proxy.address mounts[device.dev_path]=mounts[device.dev_path]or{} local dev_mounts=mounts[device.dev_path] table.insert(dev_mounts,device) end local smounts={} for key,value in pairs(mounts)do smounts[#smounts+1]={key,value} end table.sort(smounts,function(a,b)return a[1]