clarkperkins / click-shell

An extension to click that easily turns your click app into a shell utility
BSD 3-Clause "New" or "Revised" License
88 stars 17 forks source link

Add on_finished callback when shell ends #9

Closed terrettaz closed 4 years ago

terrettaz commented 5 years ago

Added new feature: callback when the shell ends. This is pretty useful to close/dispose resources in the ctx.obj. Here is an example where I use it: strava-tools#shell.py

terrettaz commented 5 years ago

new test: test_shell.py doesn't work when coverage is activated

clarkperkins commented 4 years ago

Hi @terrettaz, I'm sorry I've taken so long to respond to this! Thank you for the work you've put in. I've cherry-picked your commits over to another branch and reworked some things to make all of the tests pass. Those changes are in #16.

I'm going to close this in favor of the other PR, please feel free to re-open if there's anything else you need!

terrettaz commented 4 years ago

Hi @clarkperkins, Thank you very much for integrating the PR in your master. I will integrate this into my project. Have a nice day !