yash-rs
yash-rs copied to clipboard
Implementing built-ins (non-POSIX extensions)
This issue tracks the implementation of non-portable extensions for built-in utilities. Portable features are tracked in #7.
In the list below, built-ins are grouped by their dependent environments. However, most built-ins additionally depend on the standard output and error file descriptors and variables.
Execution control
.- Non-portable options
- [ ]
-A,--no-alias - [ ]
-L,--autoload - [ ]
--help
- [ ]
- Non-portable options
break- Non-portable options
- [ ]
-i,--iteration - [ ]
--help
- [ ]
- Non-portable options
continue- Non-portable options
- [ ]
-i,--iteration - [ ]
--help
- [ ]
- Non-portable options
eval- Non-portable options
- [ ]
-i,--iteration - [ ]
--help
- [ ]
- Non-portable options
exec- Non-portable options
- [ ]
-a ...,--as=... - [ ]
-c,--clear - [ ]
--cloexec - [ ]
-f,--force - [ ]
--help
- [ ]
- Non-portable options
exit- Semantics
- [x] Allow exit status of 256+
- [ ] Do not exit if there is a stopped job
- Non-portable options
- [ ]
-f,--force - [ ]
--help
- [ ]
- Semantics
- ~~
newgrp~~ return- Semantics
- [ ] Allow exit status of 256+
- [ ] Only return from functions and dot scripts in POSIXly-correct mode (Reject returning from trap, exiting the shell, etc.)
- Non-portable options
- [ ]
-n,--no-return - [ ]
--help
- [ ]
- Semantics
Printing
echo- [ ] Implement echo built-in
help- [ ] Implement help built-in
printf- [ ] Implement printf built-in
Working directory
cd- Semantics
- [ ] Allow
-operand used together with-Lor-Poption - [ ]
$YASH_AFTER_CD
- [ ] Allow
- Non-portable options
- [ ] Long options
- [ ]
--default-directory=... - [ ]
--help
- Semantics
dirs- [ ] Show directory stack
popd- [ ] Update directory stack
pushd- [ ] Update directory stack
pwd- Non-portable options
- [ ] Long options
- [ ]
--help
- Non-portable options
File creation mask
umask- Non-portable options
- [ ] Long options
- [ ]
--help
- Non-portable options
Limits
ulimit- Semantics
- [ ] Support limits other than file size (
-f)
- [ ] Support limits other than file size (
- Non-portable options
- [ ] Long options
- [ ]
--help
- Semantics
Spent times
times- Non-portable options
- [ ]
--help
- [ ]
- Non-portable options
Signals
kill- Semantics
- [ ] (Dis)allow signal names prefixed with
SIG - [ ] (Dis)allow non-zero numbers as an argument to
-soption - [ ] (Dis)allow signal names as operands for
-loption - [ ] (Dis)allow multiple operands with
-loption
- [ ] (Dis)allow signal names prefixed with
- Non-portable options
- [x]
-n - [x]
-v - [ ] Include descriptions with
-v - [ ]
--help
- [x]
- Semantics
suspend- [ ] Implement suspend built-in
trap- Semantics
- [ ] Allow non-uppercase signal names
- [ ] Allow signal names prefixed with
SIG
- Non-portable options
- [ ]
-p,--print - [ ]
--help
- [ ]
- Semantics
Jobs
bg- Semantics
- [ ] Allow job IDs without the
%prefix - [ ] Send SIGCONT even if the target job is already running
- [ ] Allow job IDs without the
- Non-portable options
- [ ]
--help
- [ ]
- Semantics
disown- [ ] Implement disown built-in
fg- Semantics
- [ ] Allow job IDs without the
%prefix - [ ] Allow more than one job ID operand per invocation
- [ ] Print the job number on resuming a job
- [ ] Consider saving/restoring the terminal state before/after resuming the job
- [ ] Allow job IDs without the
- Non-portable options
- [ ]
--help
- [ ]
- Semantics
jobs- Semantics
- [ ] Allow job IDs without the
%prefix
- [ ] Allow job IDs without the
- Non-portable options
- [x] Long options
- [ ]
-n,--new - [ ]
-r,--running-only - [ ]
-s,--stopped-only - [ ]
-t,--terminated-only - [ ] (Idea: option to print the locations jobs were started at)
- [ ]
--help
- Semantics
wait- Semantics
- [ ] Print job status after waiting (if interactive and monitoring)
- Non-portable options
- [ ]
--help
- [ ]
- Semantics
Variables and functions
array- [ ] Implement array built-in
export- [ ] Disable non-portable syntax in POSIX mode / Allow non-portable extensions in non-POSIX mode
- Non-portable options
- [ ]
--help - [ ] Legacy options (
-rand-X)
- [ ]
getopts- Semantics
- [ ] Allow parsing non-alphanumeric options
- Non-portable options
- [ ]
--help
- [ ]
- Semantics
local- [ ] Redirect
localtotypeset
- [ ] Redirect
read- Non-portable options
- [ ] Long options
- [ ]
-A,--array - [ ]
-e,--line-editing - [ ]
-P,--ps1 - [ ]
-p ...,--prompt=... - [ ]
--help
- Non-portable options
readonly- [ ] Disable non-portable syntax in POSIX mode / Allow non-portable extensions in non-POSIX mode
- Non-portable options
- [ ]
--help - [ ] Legacy options (
-xand-X)
- [ ]
shift- Semantics
- [ ] Allow negative operands
- Non-portable options
- [ ]
-A ...,--array=... - [ ]
--help
- [ ]
- Semantics
typeset- [ ] #316
unset- Semantics
- [ ] Allow
unsetused without any operands
- [ ] Allow
- Non-portable options
- [ ] Long options
- [ ]
-l,--local - [ ]
--help
- Semantics
Aliases
alias- Semantics
- [ ] Allow/reject non-portable alias names
- Non-portable options
- [ ]
-g,--global - [ ]
-p,--prefix - [ ]
-v,--verbose(show locations where aliases were defined) - [ ]
--help
- [ ]
- Semantics
unalias- Non-portable options
- [ ] Long options
- [ ]
--help
- Non-portable options
Command path cache
hash- Non-portable options
- [ ] Long options
- [ ]
-a,--all - [ ]
-d,--directory - [ ]
--help
- Non-portable options
Built-ins
builtin,disable(TBD)- [ ] Execute a built-in (ignoring the same-named functions)
- [ ] Disable built-ins
- [ ] Re-enable built-ins
Command history
fc- Non-portable options
- [ ] Long options
- [ ]
-q,--quiet - [ ]
-v,--verbose - [ ]
--help
- Non-portable options
history- [ ] Implement history built-in
Line-editing
bindkey- [ ] Implement bindkey built-in
complete- [ ] Implement complete built-in
Miscellaneous
[,test- [ ]
-G - [ ]
-k - [ ]
-N - [ ]
-O - [ ]
-nt,-ot - [ ]
-ef - [ ]
== - [ ] Locale-based string comparison (
===,!==,<,<=,>,>=) - [ ]
=~ - [ ] Version number comparison (
-veq,-vne,-vgt,-vge,-vlt,-vle) - [ ]
-o(unary)
- [ ]
command,type- Semantics
- [ ] Allow
-vand-Vused together - [ ] Allow more than one command name operand for
-vand-V - [ ] Disable invalid option combination (e.g.
type -f)
- [ ] Allow
- Non-portable options
- [ ] Long options
- [ ]
-a,--alias - [ ]
-b,--builtin-command - [ ]
-e,--external-command - [ ]
-f,--function - [ ]
-k,--keyword - [ ]
--help
- Semantics
set- [ ] Disable non-portable options in POSIXly-correct mode
- [ ] Disable long options in POSIXly-correct mode
- [ ] Disable non-portable use of the
noprefix - [ ] Disable non-portable normalization & case folding of option names
- [ ]
--help