def METHOD_NAME(p):
  """Flags shared between sh_spec.py and stateful/harness.py."""
  p.add_option(
      '-v', '--verbose', dest='verbose', action='store_true', default=False,
      help='Show details about test failures')
  p.add_option(
      '-r', '--range', dest='range', default=None,
      help='Execute only a given test range, e.g. 5-10, 5-, -10, or 5')
  p.add_option(
      '--regex', dest='regex', default=None,
      help='Execute only tests whose description matches a given regex '
           '(case-insensitive)')
  p.add_option(
      '--list', dest='do_list', action='store_true', default=None,
      help='Just list tests')
  p.add_option(
      '--oils-failures-allowed', dest='oils_failures_allowed', type='int',
      default=0, help="Allow this number of Oils failures")
  # Select what shells to run
  p.add_option(
      '--oils-bin-dir', dest='oils_bin_dir', default=None,
      help="Directory that osh and ysh live in")
  p.add_option(
      '--oils-cpp-bin-dir', dest='oils_cpp_bin_dir', default=None,
      help="Directory that native C++ osh and ysh live in")
  p.add_option(
      '--ovm-bin-dir', dest='ovm_bin_dir', default=None,
      help="Directory of the legacy OVM/CPython build")
  p.add_option(
      '--compare-shells', dest='compare_shells', action='store_true',
      help="Compare against shells specified at the top of each file")