Shell path resolution, alias management, and argument parsing helpers.
- Repository:
opencomputers - System:
openos - Type:
library
OpenComputers/src\main\resources\assets\opencomputers\loot\openos\lib\shell.lua
local shell = require("shell")- Description: Look up the value of a shell alias.
- Parameters:
alias
shell.getAlias(nil)- Description: Load and return the configured shell entry point.
shell.getShell()- Description: Return the current working directory, defaulting to
/.
shell.getWorkingDirectory()- Description: Split a command line into positional arguments and short or long option tables.
- Parameters:
...
shell.parse(nil)- Description: Ensure per-process shell alias and variable tables exist.
shell.prime()- Description: Resolve a path or command name against the current directory and
PATH. - Parameters:
pathext
shell.resolve(nil, nil)- Description: Assign or clear a shell alias.
- Parameters:
aliasvalue
shell.setAlias(nil, nil)- Description: Change the current working directory after validating it exists.
- Parameters:
dir
shell.setWorkingDirectory(nil)- OpenOS exposes a small bootstrap shell API first, then delays additional helpers such as command execution and
PATHaccess until the full module is loaded.