Index: optparse.rst =================================================================== --- optparse.rst (revision 69992) +++ optparse.rst (working copy) @@ -510,6 +510,14 @@ default: ``"usage: %prog [options]"``, which is fine if your script doesn't take any positional arguments. + If using the ``%`` string formatting operator to insert computed elements into a + usage string, then you will need to unsure that the ``%prog`` is properly escaped, + so that it isn't interpreted as containing an anomalous ``%p`` formatting token. + This escaping is done with a second percent sign, so that the formatted string + contains the ``%prog`` looked for by :mod:`optparse`, e.g.:: + + usage = "usage: %%prog ... %s" % mystring + * every option defines a help string, and doesn't worry about line-wrapping--- :mod:`optparse` takes care of wrapping lines and making the help output look good.