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

Introduce 'function' built-in. #77

Open
wants to merge 27 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
faab6cc
Introduce 'function' built-in
Krush206 Jul 7, 2023
b683769
sh.c: Sgoal shouldn't be assigned funcmain
Krush206 Jul 7, 2023
4d90ff3
sh.c: cleanup_push() raises SIGSEGV
Krush206 Jul 8, 2023
715a882
fargv should be freed from dofunction()
Krush206 Jul 8, 2023
5e37bfc
Move function tests to srcunit()
Krush206 Aug 5, 2023
235b358
Better function parsing
Krush206 Nov 21, 2023
4a54e05
Create tests for 'function' built-in
Krush206 Nov 21, 2023
5bc9252
sh.c: call cleanup_push() properly
Krush206 Nov 21, 2023
b1e4135
Documentation for 'function' built-in
Krush206 Nov 21, 2023
ede350d
Rename ERR_DOLFUNC to ERR_FUNC
Krush206 Nov 21, 2023
fc7dbd3
sh.func.c: prefer dolzero over ffile
Krush206 Nov 21, 2023
d762fba
sh.func.c: allocate memory properly
Krush206 Nov 21, 2023
951264d
sh.func.c: assign NULL after deallocating fargv
Krush206 Nov 22, 2023
7d6eef8
Prefer srcfile() over dosource()
Krush206 Dec 3, 2023
c60a4c2
Functions should work for sourced scripts.
Krush206 Feb 14, 2024
954cfd6
Rethought on functions
Krush206 May 18, 2024
15d4e30
Do not fork & fix interrupts
Krush206 Jun 2, 2024
042e84b
Refactor
Krush206 Jun 3, 2024
2fa7967
tcsh.man.in: correction & additional information
Krush206 Jun 3, 2024
b950b85
sh.err.c: recursion/nest
Krush206 Jun 3, 2024
d840e89
Create aliases for functions
Krush206 Jun 3, 2024
22d3150
sh.func.c: replace setexit with cleanup_push
Krush206 Jun 4, 2024
adea1b6
Avoid SIGPIPE on doexit
Krush206 Jun 4, 2024
d0167d4
sh.func.c: don't catch OLDSTD
Krush206 Jun 4, 2024
911ed6e
22d3150: move remaining parts to st_restore
Krush206 Jun 6, 2024
56e5e7d
911ed6e: more remaining parts
Krush206 Jun 7, 2024
c8b8f51
Prefer dozip over doreturn
Krush206 Jun 13, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Documentation for 'function' built-in
  • Loading branch information
Krush206 committed Jun 1, 2024
commit b1e413528d256ab8c0b1d7db6e4223bdaf621b82
34 changes: 34 additions & 0 deletions tcsh.man.in
Original file line number Diff line number Diff line change
Expand Up @@ -5521,6 +5521,30 @@ the loop are executed.
If you make a mistake typing in a
loop at the terminal you can rub it out.
.
.It Ic function Ar label Xo
.Op Ar arg
\&... (+)
.Xc
.Ar label
is a
.Ic goto
label. The shell recurses the current script,
searches for and continues execution after a line of the form
.Dl Ar label Ns No \&:
.Ar arg
is a list of arguments to be passed to
.Ic argv Ns No \&.
Use outside a label is labeled
.Ar main Ns No \&.
It's an error
.Sq Ar label Ns No \&:
not contain an ending
.Ic exit Ns No \&.
It's an error
.Ar main
not contain an ending
.Ic exit Ns No \&.
.
.El
.Bl -tag -width 6n
.
Expand Down Expand Up @@ -10642,6 +10666,12 @@ and message catalog code to interface to Windows.
.br
Color ls additions.
.
.It Matheus Garcia ,
2023.
.br
.Ic function
built-in.
.
.El
.
.Sh THANKS TO
Expand Down Expand Up @@ -10744,6 +10774,10 @@ cycles or backward
.Ic goto Ns
s.
.Pp
Functions fallthrough if the ending
.Ic exit
is piped from or executed in background.
.Pp
Report bugs at
.Lk @PACKAGE_BUGREPORT@
preferably with fixes.
Expand Down