git-repo icon indicating copy to clipboard operation
git-repo copied to clipboard

Switch CLI API dispatch framework to `docopt_dispatch`

Open guyzmo opened this issue 9 years ago • 2 comments

The current command dispatch code has been designed to avoid an over-complex main function. But it was after coding it that I discovered that the author of docopt implemented a similar framework he called docopt_dispatch.

That framework might need some adjustments for custom features built in the current command dispatch code, but it's worth using an existing and common framework than reinventing the wheel.

guyzmo avatar Jun 07 '16 12:06 guyzmo

Any docopt-alike implementation is very fast for development, but it has limitations that can't be fixed: You can't allow to implement addiotional commands/options. This will block plugin author from adding service-specific commands (i.e. for service with locally-accessible repositories something like git --git-dir=/home/git/gogs-repositories/user/repo.git remote ...).

pyhedgehog avatar Dec 24 '16 05:12 pyhedgehog

well, this is a more global design issue, and this discussion better fits in #28 …

This issue is only there as a reminder to replace my custom command "dispatch" with docopt_dispatch, because I basically reinvented the wheel without knowing.

guyzmo avatar Dec 24 '16 09:12 guyzmo