Skip to content
This repository has been archived by the owner on Jan 6, 2025. It is now read-only.

Camelot overrides click.HelpFormatter.write_usage #343

Closed
dimitern opened this issue Jun 15, 2019 · 2 comments
Closed

Camelot overrides click.HelpFormatter.write_usage #343

dimitern opened this issue Jun 15, 2019 · 2 comments

Comments

@dimitern
Copy link
Contributor

Hey @vinayak-mehta, and thank you for making Camelot and Excalibur!

While working on adding tests for Excalibur (camelot-dev/excalibur#49), I've noticed this code:

def _write_usage(self, prog, args='', prefix='Usage: '):
    return self._write_usage('camelot', args, prefix=prefix)


# monkey patch click.HelpFormatter
HelpFormatter._write_usage = HelpFormatter.write_usage
HelpFormatter.write_usage = _write_usage

This monkey patching causes Excalibur's (or any other click-based) CLI to return camelot for the program name in the help output, which is a bit confusing, so I decided to add this issue and propose a PR to fix it.

@vinayak-mehta
Copy link
Contributor

Thanks for raising this issue and the corresponding PR! I didn't know about the name kwarg in click.group at the time and resorted to this monkey patch. Please give me some time to review and merge your PR.

@dimitern
Copy link
Contributor Author

dimitern commented Jul 4, 2019

Closing in favour of camelot-dev/camelot#5

@dimitern dimitern closed this as completed Jul 4, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants