diff --git a/src/net/torvald/terrarum/virtualcomputer/assets/loots/dummix/bin/cp.lua b/src/net/torvald/terrarum/virtualcomputer/assets/loots/dummix/bin/cp.lua old mode 100644 new mode 100755 index 3a9f6e17e..eae110a74 --- a/src/net/torvald/terrarum/virtualcomputer/assets/loots/dummix/bin/cp.lua +++ b/src/net/torvald/terrarum/virtualcomputer/assets/loots/dummix/bin/cp.lua @@ -1,2 +1,6 @@ local args = {...} +if (#args ~= 2) then +print([[usage: cp source_file target_file + cp source_file target_directory]]) +return end fs.cp(os.expandPath(args[1]), os.expandPath(args[2])) \ No newline at end of file diff --git a/src/net/torvald/terrarum/virtualcomputer/assets/loots/dummix/bin/dsh.lua b/src/net/torvald/terrarum/virtualcomputer/assets/loots/dummix/bin/dsh.lua index b680bc502..576cfff1b 100755 --- a/src/net/torvald/terrarum/virtualcomputer/assets/loots/dummix/bin/dsh.lua +++ b/src/net/torvald/terrarum/virtualcomputer/assets/loots/dummix/bin/dsh.lua @@ -98,9 +98,11 @@ local function exec(tArgs) -- do some sophisticated file-matching -- step 1: exact file - if fs.isFile(fullFilePath) then shell.run(fullFilePath, execArgs) + if fs.exists(fullFilePath) and fs.isFile(fullFilePath) then + shell.run(fullFilePath, execArgs) -- step 2: try appending ".lua" - elseif fs.isFile(fullFilePath..".lua") then shell.run(fullFilePath..".lua", execArgs) + elseif fs.exists(fullFilePath..".lua") and fs.isFile(fullFilePath..".lua") then + shell.run(fullFilePath..".lua", execArgs) -- step 3: parse os.path (just like $PATH) -- step 3.1: exact file; step 3.2: append ".lua" elseif not startsFromRoot(filePath) then @@ -110,11 +112,11 @@ local function exec(tArgs) debug(path..filePath) - if fs.isFile(path..filePath) then + if fs.exists(path..filePath) and fs.isFile(path..filePath) then execByPathArg = path..filePath execByPathFileExists = true break - elseif fs.isFile(path..filePath..".lua") then + elseif fs.exists(path..filePath..".lua") and fs.isFile(path..filePath..".lua") then execByPathArg = path..filePath..".lua" execByPathFileExists = true break diff --git a/src/net/torvald/terrarum/virtualcomputer/assets/loots/dummix/bin/mv.lua b/src/net/torvald/terrarum/virtualcomputer/assets/loots/dummix/bin/mv.lua old mode 100644 new mode 100755 index 2d1e7c61f..ca1189fc1 --- a/src/net/torvald/terrarum/virtualcomputer/assets/loots/dummix/bin/mv.lua +++ b/src/net/torvald/terrarum/virtualcomputer/assets/loots/dummix/bin/mv.lua @@ -1,2 +1,6 @@ local args = {...} +if (#args ~= 2) then +print([[usage: mv source target + mv source ... directory]]) +return end fs.mv(os.expandPath(args[1]), os.expandPath(args[2])) \ No newline at end of file