Shell path resolution, alias management, and argument parsing helpers.
- Repository:
opencomputers - System:
plan9k - Type:
library
OpenComputers/src\main\resources\assets\opencomputers\loot\plan9k\lib\shell.lua
local shell = require("shell")- Description: Iterate the alias table for the current process.
shell.aliases()- Description: Run a command string through the configured shell entry point and return the child result.
- Parameters:
commandenv...
shell.execute(nil, nil, nil)- Description: Look up the value of a shell alias.
- Parameters:
alias
shell.getAlias(nil)- Description: Return the current
PATHenvironment variable.
shell.getPath()- 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: Resolve a path or command name against the current directory and
PATH. - Parameters:
pathext
shell.resolve(nil, nil)- Description: Expand the first command token through the alias table before execution continues.
- Parameters:
commandargs
shell.resolveAlias(nil, nil)- Description: Assign or clear a shell alias.
- Parameters:
aliasvalue
shell.setAlias(nil, nil)- Description: Replace the current
PATHenvironment variable. - Parameters:
value
shell.setPath(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.