clarkperkins / click-shell

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

Allow to subclass ClickShell #22

Closed lambdafu closed 3 years ago

lambdafu commented 4 years ago

Currently, ClickShell is not exported from click_shell, and it is also hardcoded in make_click_shell and Shell. This means that users of click-shell can not subclass ClickShell (and thus Cmd), for example to add custom precmd and postcmd handler.

I guess a straightforward way to implement this would be to allow parametrization of the ClickShell class in the above functions and to export its definition (of course, instead it can be imported from click_shell.core).

clarkperkins commented 3 years ago

Hi @lambdafu, thanks for the suggestion! I'll get this included in the next release. Sorry for the long delay!