Tags: rubiojr/rugo
Tags
add signal module for graceful OS signal handling
New stdlib module: use "signal"
signal.on("INT", fn()
puts "shutting down"
exit(0)
end)
signal.wait()
Supports INT, TERM, HUP, QUIT, USR1, USR2, WINCH, PIPE, and ALRM.
Handlers are race-free — they run on the goroutine that calls
signal.wait(), so they never conflict with the rest of your program.
Functions:
signal.on(name, handler) — register a handler
signal.wait() — block and dispatch handlers as signals arrive
signal.reset(name) — stop invoking a handler
signal.ignore(name) — ignore a signal entirely
fix: cli module separates -- passthrough from positional args cli.args() now returns only the arguments before a "--" separator, and a new cli.passthrough() returns everything after it. This keeps a command's own arguments from being mixed up with arguments meant to be forwarded to another command.
PreviousNext