ela
Contents

ManualShell

Built-ins

In the terminalela --spec built-ins

These change the shell itself or report on it, so they run inside it, in the shell and in scripts alike. umask and ulimit change what ela's own process passes on: as programs they would change only themselves. Each runs alone on its line; one that reports also runs alone in $( ), which captures what it says: path = $(which git). echo and warn write text.

Built-inDoes
cd pathChanges directory
cd -Returns to the previous directory
cd ... / cd ....Goes up two / three levels
umask [mask]Sets the mask taken off the mode of every file made after it, in octal: umask 077 keeps new files to their owner. With no mask it prints it, 0022
ulimit [-H] [-c|-d|-f|-l|-n|-s|-t|-u|-v [value]]Sets a resource limit of the shell and every program it starts after: -n open files, -c the core file's size, -s the stack, -u processes, -t CPU seconds, -d, -f, -l and -v the data, a file's, locked and virtual memory. A size is in KiB, as bash gives it, and unlimited lifts a limit. It sets the soft limit, up to the hard one; -H first sets the hard limit, which only root raises. With a letter and no value it prints that limit; alone it lists them all, soft and hard
exit codeExits the shell
fail "message"[, kind|cause|code]Raises an Error, which try on a call above it catches; with none, writes ela: and its chain to stderr and stops the script with exit 1, or the code given, from 1 to 255, its deferred lines run first. At the prompt the Error is said and the prompt carries on (LANGUAGE.md, fail)
echo [-n] words...Writes its words to stdout, a value as ela writes it, and a word written as a call, echo len($xs), as its value (LANGUAGE.md, echo prints any value)
warn words...Writes the words to stderr, a space apart and a newline after, as echo writes them to stdout: warn "mirror unreachable ($code)". No prefix, so the message is the script's own; it runs alone, in a $( ) too, and a redirect is refused, since a message for a file is echo's
historyLists the history, numbered from the oldest; a block's later lines are indented under its first
which name...Says what each name is to ela, one line a meaning, in the order a command looks: an alias, a shell built-in or keyword, a program on PATH; then a proc, a built-in proc, a package or package proc, an import, a struct or an enum. With one name the lines are bare, so $(which git) is the path; with several each starts with its name. A name with no meaning fails as a missing command does; try which name gives 1
varsLists every variable in scope with its type, then the constants; in a proc, its own and then the constants
procsLists every proc declared and imported, with its parameters
aliasesLists the aliases; in a script, which has none, it says so on stderr
spin "label" cmd args...Runs the command behind a spinner at a terminal, its output held back and printed if it fails; spin "label" alone on its line opens a block, closed by end spin (LANGUAGE.md, Progress and spinners)
jobs, fg, bgList the session's jobs, bring one to the front, let a stopped one carry on; at the prompt only (Job control)
  • No pushd / popd: with dir "path" changes to a folder for a block and comes back at end with (LANGUAGE.md, with).