You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I agree, while in the other formatters you can use console markup to add special styles for defaults, this is not currently possible with ArgumentDefaultsRichHelpFormatter. I am not clear how to best handle this yet.
There are multiple options for where this should go:
If only for the ArgumentDefaultsRichHelpFormatter formatter: we need to override its _get_help_string method
If for all formatters: this then has to go in the _rich_expand_help method
There is also the question about what needs to be considered for styling:
Only the default value: "foo bar (default: [argparse.defaults]%(default)s[/argparse.defaults])"
The default and the surrounding parenthesis: "foo bar[argparse.defaults](default: %(default)s)[argparse.defaults]". This may not always work if the user doesn't stick to the (default: %(default)s) format. I lean toward option 1 here.
Awesome plugin.
When using
formatter_class=ArgumentDefaultsRichHelpFormatter
Currently the default values display fine but it would be nice to pretty-print them if possible.
![image](https://private-user-images.githubusercontent.com/26625123/259073133-fc616138-51e7-4c96-b91f-916a757d7c6f.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjA0NjA5ODQsIm5iZiI6MTcyMDQ2MDY4NCwicGF0aCI6Ii8yNjYyNTEyMy8yNTkwNzMxMzMtZmM2MTYxMzgtNTFlNy00Yzk2LWI5MWYtOTE2YTc1N2Q3YzZmLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA3MDglMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwNzA4VDE3NDQ0NFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTBlZmIwYWY3YmFiNzlhNWM1NjUyODliMmU0NGJjNzUzY2VlZWFiNGU4N2Q0NzgwOTdhMmY3ZDY3NTM1OTJkMTMmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.yqRHAFeX1zaLdiJvMNnaN91BJH18P6qzzIbaGsrbx2Q)
Example of current:
I don't mind attempting a PR for it.
The text was updated successfully, but these errors were encountered: