call On Close
Register a callback to be called when this command and all its subcommands have finished.
This is useful for resources that need to be shared across multiple commands.
If your resource implements AutoCloseable, you should use registerCloseable instead.
Example
currentContext.callOnClose { myResource.close() }Content copied to clipboard