Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Formatted text in help text not rendered properly #32

Open
carniz opened this issue Nov 5, 2019 · 1 comment
Open

Formatted text in help text not rendered properly #32

carniz opened this issue Nov 5, 2019 · 1 comment

Comments

@carniz
Copy link

carniz commented Nov 5, 2019

An example Click command has the following help text:

def convert(input_file_name, output_file_name):
	"""
	Converts the format of the \033[1minput file\033[0m and stores it in the \033[1moutput file\033[0m
	"""

When invoking the --help option for the command the words "input file" and "output file" are displayed with a bold font.

However, the man page generated with python3 setup.py --command-packages=click_man.commands man_pages displays it as [1minput file[0m and [1moutput file[0m.

@mngshm
Copy link

mngshm commented Sep 21, 2024

This is because \033[1m is related to invoking colors in terminal. Instead of raw declaring of the colors, I'd suggest you assign them to variables first and then wrap particular text arround the color variables.

Ref: https://stackoverflow.com/questions/287871/how-do-i-print-colored-text-to-the-terminal

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants