old_contents: #!/usr/bin/env python3
  VERSION="0.0"
  DESCRIPTION="Description of program. (Version: %s)" % VERSION
  
  import sys, argparse
  
  def parse_cmd_line():
      parser = argparse.ArgumentParser(description=DESCRIPTION)
      args, unknown = parser.parse_known_args()
      setattr(args, 'unknown', unknown)
      return args
  
  def main():
      args = parse_cmd_line()
      return 0
  
  if __name__ == '__main__':
      sys.exit(main())
  
new_contents: #!/usr/bin/env python3
  """
  """
  
  import sys, argparse
  
  
  VERSION = "0.0"
  VERBOSE = False
  DEBUG = False
  
  
  def main():
      args = parse_cmd_line()
      dprint(args)
      return 0
  
  
  def parse_cmd_line():
      parser = argparse.ArgumentParser(description=__doc__)
      parser.add_argument(
          '--version', help='Print the version and exit.', action='version',
          version='%(prog)s {}'.format(VERSION))
      DebugAction.add_parser_argument(parser)
      VerboseAction.add_parser_argument(parser)
      return parser.parse_args()
  
  
  def dprint(msg):
      """Conditionally print a debug message."""
      if DEBUG:
          print(msg)
  
  
  def vprint(msg):
      """Conditionally print a verbose message."""
      if VERBOSE:
          print(msg)
  
  
  class DebugAction(argparse.Action):
      """Enable the debugging output mechanism."""
  
      flag = '--debug'
      help = 'Enable debugging output.'
  
      @classmethod
      def add_parser_argument(cls, parser):
          parser.add_argument(cls.flag, help=cls.help, action=cls)
  
      def __init__(self, option_strings, dest, **kwargs):
          super(DebugAction, self).__init__(option_strings, dest, nargs=0,
                                            default=False, **kwargs)
  
      def __call__(self, parser, namespace, values, option_string=None):
          print('Enabling debugging output.')
          global DEBUG
          DEBUG = True
          setattr(namespace, self.dest, True)
  
  
  class VerboseAction(DebugAction):
      """Enable the verbose output mechanism."""
  
      flag = '--verbose'
      help = 'Enable verbose output.'
  
      def __call__(self, parser, namespace, values, option_string=None):
          print('Enabling verbose output.')
          global VERBOSE
          VERBOSE = True
          setattr(namespace, self.dest, True)
  
  
  if __name__ == '__main__':
      try:
          sys.exit(main())
      except SystemExit:
          sys.exit(0)
      except KeyboardInterrupt:
          print('...interrupted by user, exiting.')
          sys.exit(1)
      except Exception as exc:
          if DEBUG:
              raise
          else:
              print('Unhandled Error:\n{}'.format(exc))
              sys.exit(1)
  
subject: add some helpful boilerplate to the python3 template file