fediverse-devnet / feditest

A testing framework for distributed, heterogeneous systems communicating with complex protocols, such as the Fediverse
https://feditest.org/
MIT License
31 stars 6 forks source link

ArgumentParser/Subparser passing #294

Closed jernst closed 4 weeks ago

jernst commented 1 month ago

Just came across the global command_parser in cli.list-templates.py, which I had overlooked earlier (mypy is complaining).

This is to provide a better help message from the sub-parser rather than the parent parser, right @steve-bate ? Looking at the other commands, it appears to me that the parser that's being passed into run is actually not used for anything other than printing help messages... and chances are, those other commands could benefit from more specific messages, too.

What about we pass the sub-parser into all the run methods instead of the parent parser, and the we can do parser.print_help() without extra workarounds like the global in all the commands?

steve-bate commented 1 month ago

Yes, I think that's a good idea. However, I'm not sure we even need (or want) this command at this point. We really want a "--list-report-styles" command, right?