fsfe / reuse-tool

reuse is a tool for compliance with the REUSE recommendations.
https://reuse.software
402 stars 148 forks source link

Switch from `argparse` to `click` #1000

Closed carmenbianca closed 1 month ago

carmenbianca commented 5 months ago

So this is fairly low-priority, but the spaghetti nature of main functions is starting to bother me.

Currently, for every subcommand, we have to implement an add_arguments and a run. Each such function is currently in its own Python file, but we could re-organise this if we wanted.

Especially as pertains annotate, these functions are not pretty. I am convinced that they can be made a lot simpler using click.

Also, click makes it lots easier to pass contexts to subcommands. Currently, a Project object is created regardless of subcommand, which is not at all needed for download (except in certain circumstances…).