ezrosent / frawk

an efficient awk-like language
Apache License 2.0
1.24k stars 34 forks source link

Add exit #77

Closed ezrosent closed 2 years ago

ezrosent commented 2 years ago

This PR adds support for the exit command to frawk, which should close out #71

Most of the complexity here is around providing useful semantics for exit when it is invoked from a parallel script. The overall strategy here is that if exit is called from a worker thread it will cut off input for all other threads, leading them to hopefully exit early. At that point, the main thread can do an orderly shutdown with the proper exit code.

jicksaw commented 2 years ago

@ezrosent https://github.com/ezrosent/frawk/blob/master/info/overview.md#what-is-missing still says that exit isn't supported

ezrosent commented 2 years ago

Thank you for catching that! Updated the text.