If no args are passed to HelpFormatter.write_usage, the Usage line is not printed.
Reproduction
import click
f = click.HelpFormatter()
f.write_usage("program")
print(f.getvalue())
Expected output
Actual output
(an empty line)
Environment
- Python version: 3.12.3
- Click version: 8.3.1
Additional information
We use click for a CLI program with interactive mode. We are about to use click.HelpFormatter to print help for internal commands, some of which do not accept any arguments (exit, for example).
If no
argsare passed toHelpFormatter.write_usage, the Usage line is not printed.Reproduction
Expected output
Actual output
(an empty line)
Environment
Additional information
We use
clickfor a CLI program with interactive mode. We are about to useclick.HelpFormatterto print help for internal commands, some of which do not accept any arguments (exit, for example).