Monkey-patch the help text when showing management command help in rb-site.
Review Request #11361 — Created Jan. 7, 2021 and submitted
rb-site manage ... <command> --help, we'd show the
standard management command help text that Django displays. This would
end up showing the wrong program invocation, which wasn't helpful. For
When we wanted something like:rb-site manage /var/www/reviewboard set-siteconfig
This change fixes that by ditching the
wrapper function and instead creating a
where we set the correct program name in order to get the right command
in the standard
manage.py --helplist of commands. We then pass in
rb-site-manageas a placeholder program name, which gets replaced in a
monkey-patched parser wrapper.
This is, unfortunately, the only way to do that without outright
replacing Django management command infrastructure, but should be safe
rb-site manage /path/to/site -- --helpand
rb-site manage /path/to/site <command> -- --helpfor several different
commands. Saw a useful "usage:" line in the help with the full command.