Skip to content

Commit

Permalink
Add version, proper usage, and epilog information to the parser.
Browse files Browse the repository at this point in the history
  • Loading branch information
tupton committed Dec 10, 2010
1 parent 14266da commit 23d7e9f
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion pastebin.py
Expand Up @@ -6,6 +6,11 @@
import optparse
import time

VERSION = """%prog 0.1b by Thomas Upton
Use `%prog -h` for help and a list of options.
"""

PASTEBIN_API = "http://pastebin.com/api_public.php"

def copy_text(text):
Expand All @@ -22,7 +27,8 @@ def create_opt_parser():
Creates an option parser using optparse
"""

parser = optparse.OptionParser("Paste text to pastebin.com")
parser = optparse.OptionParser(usage="%prog [-hc] [-f file]", epilog="Paste text to pastebin.com.",
version=VERSION)

parser.add_option('-c', '--copy', default=False, action='store_true',
help="copy the text that is posted to pastebin.com before copying the pastebin.com URL")
Expand Down

0 comments on commit 23d7e9f

Please sign in to comment.