rich-argparse icon indicating copy to clipboard operation
rich-argparse copied to clipboard

Disable markup by default

Open hamdanal opened this issue 10 months ago • 1 comments

This issue is to collect feedback before making the change.

I am thinking about making rich markup opt-in instead of opt-out. This of course would require a major version bump so I am thinking of making it part of the 2.0 release.

There has been at least one person asking for markup to be disabled by default https://github.com/hamdanal/rich-argparse/discussions/120#discussioncomment-9486951. I find the arguments presented in that discussion convincing but couldn't change the default at the time as it would be a breaking change.

Long term, it would be a better user experience if rich-argparse behavior matches exactly that of argparse (except for the colors). This is especially useful for these two scenarios:

  1. Large projects that adopt rich-argparse where it would be easy to miss a few square brackets in the help strings
  2. Projects that would offer optional rich-argparse support and fallback to standard argparse if rich-argparse is not installed

I am not sure if there should be a warning at runtime and how annoying it would be for users. It might be possible to detect the use of markup syntax and only issue a warning if markup is used while not explicitly activated. As a reminder, RichHelpFormatter.help_markup = True would activate markup for help strings and RichHelpFormatter.text_markup = True would activate markup for descriptions/epilog.

hamdanal avatar Feb 01 '25 14:02 hamdanal

Long term, it would be a better user experience if rich-argparse behavior matches exactly that of argparse (except for the colors).

I support this change and agree with your reasoning.

kmvanbrunt avatar Jun 26 '25 19:06 kmvanbrunt