+###
+### COMMAND LINE PARSING
+###
+
+parser = OptionParser()
+parser.prog = __name__
+parser.version = __version__
+parser.description = __description__
+parser.usage = '%prog [options] <message>'
+parser.add_option('-a', '--auto', dest='auto',
+ default=False, action='store_true',
+ help='turn on template auto-discovery')
+parser.add_option('-m', '--menu', dest='menu',
+ default=False, action='store_true',
+ help='choose from a list of templates (not yet implemented)')
+parser.add_option('-n', '--new', dest='new',
+ default=False, action='store_true',
+ help='create a new message')
+parser.add_option('-e', '--editor', dest='edit',
+ default=False, action='store_true',
+ help='spawn editor once template is applied')
+parser.add_option('-k', '--keep-unknown', dest='keep_unknown',
+ default=False, action='store_true',
+ help='preserve mail headers not specified in template')
+parser.add_option('-v', '--verbose', dest='verbose',
+ default=False, action='store_true',
+ help='write informational messages to stderr')
+parser.add_option('-d', '--debug', dest='debug',
+ default=False, action='store_true',
+ help='start a debugger after initialisation')
+parser.add_option('-V', '--version', dest='version',
+ default=False, action='store_true',
+ help='display version information')
+
+options, args = parser.parse_args()
+
+if options.version:
+ print(__name__, __version__ + ' — ' + __description__)
+ print('')
+ print('Written by ' + __author__)
+ print(__copyright__)
+ print('Released under the ' + __licence__)
+ sys.exit(posix.EX_OK)
+