diff --git a/clite/commands.js b/clite/commands.js index 8f60ef1..fa333e8 100644 --- a/clite/commands.js +++ b/clite/commands.js @@ -485,9 +485,107 @@ clite.commands.load('view',function(args,env,io) { return 0; }); -clite.commands.load('edit',function(args,env,io) { - stdio.printf('edit is under development'); - return 0; +clite.commands.load('rm',function(args,env,io) { + var short = null; + var file = null; + var stdio = io.include('stdio'); + var clite = io.include('clite'); + var recurse = false; + var force = false; + function help() { + stdio.printf(` +rm - remove files or directories +Usage: file [OPTION] + +Options: +-r Remove directories and their contents recusively +-f Ignore nonexistant files and arguments +-? Print this help information + `); + } + + for (var i=1; i Options: -? Print this help information diff --git a/clite/core.js b/clite/core.js index f2c83c3..ef9a406 100644 --- a/clite/core.js +++ b/clite/core.js @@ -1116,7 +1116,8 @@ clite.io = { var fd = getFileDes(pid,path,true,null); if (!fd || !fd.canwrite || fd.node.data.isdev) return false; - return vfsapi.remove(path); + var uid = clite.proc.getUID(pid); + return vfsapi.remove(uid,path); } clite.io.link = function(pid,path,target) { if (!getFileDes(pid,target,false,null))