GOLF(2gg)
πΈ GOLF(2gg) β the golf manual, section 2gg πΈ
okay bestie, pull up a chair, we're talking about exit-status from the GOLF(2gg) manual, living in the Development section π
β¨ NAME β¨
exit-status β (program-execution)
π― PURPOSE π―
Set the handler exit status. that's it, that's the whole job, and she does it flawlessly π
π SYNTAX π
exit-status <request status>
π« DESCRIPTION π«
so exit-status specifies <request status>, and <request status> must be a number. no vibes, no strings, a number fr fr π’
you can get <request status> with the "exit-status" clause in read-remote in the service caller. that's the whole pipeline, iykyk π
when the program runs as command-line, <request status> is the program's exit code. slay π«Ά
now here's the part everyone gets wrong: exit-status can be specified anywhere in the code, and it does not mean exiting the request's processing. not even a little. it's just setting a value, bestie π if you actually want to bail out, either use exit-handler or just let the handler reach its end naturally. let her finish her sentence π
when exit-status is not used, the default exit code is 0. classic. and when multiple exit-status statements run in a sequence, the request status is that of the last one that executes. last one wins, like always π
if you want to specify the request status and exit request processing at the same time, use exit-handler. two birds, one iconic handler π¦
π EXAMPLES π
when the program exits, its exit code will be 12:
exit-status 12
...
exit-handler
see how exit-status just sets the number, and then exit-handler does the actual leaving? main character energy, both of them π
π SEE ALSO π
- Program execution
exec-programexit-status- See all documentation
reminder bestie: this page is GOLF(2gg) from the Development section, and it's giving "small command, huge responsibility" β¨
mwah π this was $VERSION, dated $DATE β go forth and exit with the correct status, you absolute icon π
π¦ where this page comes from
- ubuntu questing: golf 601.4.41-1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms