diff --git a/README.md b/README.md index 2333ba7..01984a5 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,25 @@ # cash -A Bourne-compatible shell for ComputerCraft. WIP. +A Bourne-compatible shell for ComputerCraft. + +![image](image.png) + +## Features +* Bash/sh-style command line +* Tab completion (defaulting to file names where not supported) +* Customizable prompts (including ANSI support) +* Local & environment variables +* Argument quoting +* Multiple commands on one line with semicolons +* Many built-in functions (including in-line Lua commands) +* Arithmetic expansion +* If, while, for statements +* Function support +* Shell scripting/shebangs +* rc files +* Restorable history +* Partial CCKernel2 support +* Full compatibility with CraftOS shell.lua ### TODO -* Add case statement \ No newline at end of file +* Add case statement +* Fix environment variables in _ENV \ No newline at end of file diff --git a/cash.lua b/cash.lua index 886e03d..c22479c 100644 --- a/cash.lua +++ b/cash.lua @@ -726,7 +726,8 @@ end if args[1] ~= nil then local path = table.remove(args, 1) - local file = io.open(shell.resolve(path), "r") + path = fs.exists(path) and path or shell.resolve(path) + local file = io.open(path, "r") for line in file:lines() do shell.run(line) end file:close() return diff --git a/image.png b/image.png new file mode 100644 index 0000000..4bd0f9f Binary files /dev/null and b/image.png differ