code: def get_option_parser():
      
      import optparse
  
      prs = optparse.OptionParser(
          usage=(
              "$0 pyrpo [-h] [-v] [-q] [-s .] "
              "[-r <report>] [--thg]"))
  
      prs.add_option('-s', '--scan',
                     dest='scan',
                     action='append',
                     default=[],
                     help='Path(s) to scan for repositories')
  
      prs.add_option('-r', '--report',
                     dest='reports',
                     action='append',
                     default=[],
                     help=("""origin, status, full, gitmodule, json, sh, """
                           """str, pip, hgsub"""))
      prs.add_option('--thg',
                     dest='thg_report',
                     action='store_true',
                     help='Write a thg-reporegistry.xml file to stdout')
  
      prs.add_option('--template',
                     dest='report_template',
                     action='store',
                     help='Report template')
  
      prs.add_option('-v', '--verbose',
                     dest='verbose',
                     action='store_true',)
      prs.add_option('-q', '--quiet',
                     dest='quiet',
                     action='store_true',)
  
      return prs
docs: Build an ``optparse.OptionParser`` for pyrpo commandline use