added option "--exit-hook"