~emersion/mrsh

mrsh/builtin/builtin.c -rw-r--r-- 5.0 KiB
819e0495 — Issam Maghni 5 months ago
Nitpick details about buit-ins

* exec and trap are special built-ins
* Add remaining utilities as comments
* type now recognizes special built-ins
builtin/trap: proper escaping when printing traps

References: https://github.com/emersion/mrsh/issues/137
builtin: add exec implementation
builtin: add very basic trap implementation
Use the len/cap wording in collect_vars
Make mrsh_collect_vars private
Move a lot of internal state to mrsh_state_priv
shell: hide definitions of mrsh_{variable,function}
builtin/hash: new utility

This implements a minimal hash(1) utility, without any caching.
builtins: implement return
builtin: add very basic jobs implementation

This only displays a list of all jobs for now. No options are supported, the
status and current columns are only partially implemented.
Mostly implement break and continue builtins

The main thing that's missing here is moving the number of loops into
the call stack:

http://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html#break

To prevent you from breaking out of your caller's loop in a function.
Implement 'wait' builtin
Add command -v builtin.
21468dfb — Cristian Adri├ín Ontivero 1 year, 8 months ago
Rename *_func_t types to *_func

POSIX reserves the _t suffix, so it's advisable to avoid it.
Implemented ulimit builtin
Abort when unspecified commands are attempted
Very basic umask implementation

Doesn't yet support the -S flag, or symbolic modes, but does allow for
getting and setting the umask.
Rename source builtin to dot

For consistency with POSIX
Next