Skip to content

Instantly share code, notes, and snippets.

@ghl3
Created April 26, 2012 19:15
Show Gist options
  • Select an option

  • Save ghl3/2502179 to your computer and use it in GitHub Desktop.

Select an option

Save ghl3/2502179 to your computer and use it in GitHub Desktop.
Using the main function's doctags as the optparse description
import optparse
desc = " ".join(main.__doc__.split())
vers = "1.0"
parser = optparse.OptionParser( description = desc, version = vers, usage = "%prog [options]" )
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment