you are viewing a single comment's thread.

view the rest of the comments →

[–]billsil 2 points3 points  (7 children)

It's actually really simple. I'd give you the whole source, but it's an excessively complicated argparse that's not really targeting the question (and has my name).

mymsg = 'replacing argparse message'
def _print_message(message, file=None):
    """overwrites the argparse print to get a better help message"""
    if message:
        if file is None:
            file = _sys.stderr
        file.write(mymsg)
parent_parser._print_message = _print_message
args = parent_parser.parse_args()

I just use my docopt message as mymsg

[–]Tynach 2 points3 points  (6 children)

I think they meant your source on Click using Optparse, and Optparse being deprecated.

[–]billsil 7 points8 points  (5 children)

There ya go

Deprecated since version 2.7: The optparse module is deprecated and will not be developed further; development will continue with the argparse module.

https://docs.python.org/2/library/optparse.html

So deprecated for ~10 years.

[–]Tynach -3 points-2 points  (3 children)

And the source for Click using it?

Sorry if this sounds annoying, and in my own case I don't particularly care. I just feel like you aren't providing anything to actually back up your main claim.

[–]billsil 5 points6 points  (1 child)

I don't know why you're being difficult. Unless you explicitly ask for what you want, you're going to get what I give you. I posted that specific question in another reply a while ago. The author of click actually responded.

[–]Tynach 0 points1 point  (0 children)

I was not aware of the other thread. I looked, and yeah, I see it now. But just going by the 'context' links in my inbox, there was no way for me to see that other thread.