Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implementing built-ins (non-POSIX extensions) #265

Open
Tracked by #41
magicant opened this issue May 28, 2023 · 0 comments
Open
Tracked by #41

Implementing built-ins (non-POSIX extensions) #265

magicant opened this issue May 28, 2023 · 0 comments
Labels
tracker List of subtasks

Comments

@magicant
Copy link
Owner

magicant commented May 28, 2023

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
  • break
    • Non-portable options
      • -i, --iteration
      • --help
  • continue
    • Non-portable options
      • -i, --iteration
      • --help
  • eval
    • Non-portable options
      • -i, --iteration
      • --help
  • exec
    • Non-portable options
      • -a ..., --as=...
      • -c, --clear
      • --cloexec
      • -f, --force
      • --help
  • exit
    • Semantics
      • Allow exit status of 256+
    • Non-portable options
      • -f, --force
      • --help
  • 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

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 -L or -P option
      • $YASH_AFTER_CD
    • Non-portable options
      • Long options
      • --default-directory=...
      • --help
  • dirs
    • Show directory stack
  • popd
    • Update directory stack
  • pushd
    • Update directory stack
  • pwd
    • Non-portable options
      • Long options
      • --help

File creation mask

  • umask
    • Non-portable options
      • Long options
      • --help

Limits

  • ulimit
    • Semantics
      • Support limits other than file size (-f)
    • Non-portable options
      • Long options
      • --help

Spent times

  • times
    • Non-portable options
      • --help

Signals

  • kill
    • Semantics
      • (Dis)allow signal names prefixed with SIG
      • (Dis)allow non-zero numbers as an argument to -s option
      • (Dis)allow signal names as operands for -l option
      • (Dis)allow multiple operands with -l option
    • Non-portable options
      • -n
      • -v
      • Include descriptions with -v
      • --help
  • suspend
    • Implement suspend built-in
  • trap
    • Semantics
      • Allow non-uppercase signal names
      • Allow signal names prefixed with SIG
    • Non-portable options
      • -p, --print
      • --help

Jobs

  • bg
    • Semantics
      • Allow job IDs without the % prefix
      • Send SIGCONT even if the target job is already running
    • Non-portable options
      • --help
  • 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
    • Non-portable options
      • --help
  • jobs
    • Semantics
      • Allow job IDs without the % prefix
    • Non-portable options
      • Long options
      • -n, --new
      • -r, --running-only
      • -s, --stopped-only
      • -t, --terminated-only
      • (Idea: option to print the locations jobs were started at)
      • --help
  • wait
    • Semantics
      • Print job status after waiting (if interactive and monitoring)
    • Non-portable options
      • --help

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 (-r and -X)
  • getopts
    • Semantics
      • Allow parsing non-alphanumeric options
    • Non-portable options
      • --help
  • local
    • Redirect local to typeset
  • read
    • Non-portable options
      • Long options
      • -A, --array
      • -e, --line-editing
      • -P, --ps1
      • -p ..., --prompt=...
      • --help
  • readonly
    • Disable non-portable syntax in POSIX mode / Allow non-portable extensions in non-POSIX mode
    • Non-portable options
      • --help
      • Legacy options (-x and -X)
  • shift
    • Semantics
      • Allow negative operands
    • Non-portable options
      • -A ..., --array=...
      • --help
  • typeset
  • unset
    • Semantics
      • Allow unset used without any operands
    • Non-portable options
      • Long options
      • -l, --local
      • --help

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
  • unalias
    • Non-portable options
      • Long options
      • --help

Command path cache

  • hash
    • Non-portable options
      • Long options
      • -a, --all
      • -d, --directory
      • --help

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
  • 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 -v and -V used together
      • Allow more than one command name operand for -v and -V
      • Disable invalid option combination (e.g. type -f)
    • Non-portable options
      • Long options
      • -a, --alias
      • -b, --builtin-command
      • -e, --external-command
      • -f, --function
      • -k, --keyword
      • --help
  • set
    • Disable non-portable options in POSIXly-correct mode
    • Disable long options in POSIXly-correct mode
    • Disable non-portable use of the no prefix
    • Disable non-portable normalization & case folding of option names
    • --help
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
tracker List of subtasks
Projects
None yet
Development

No branches or pull requests

1 participant