def generate_arg_parser()

in tools/codesigningtool/codesigningtool.py [0:0]


def generate_arg_parser():
  """Returns the arugment parser for the code signing tool."""
  parser = argparse.ArgumentParser(description="codesign wrapper")
  parser.add_argument(
      "--target_to_sign", type=str, action="append", help="full file system "
      "paths to a target to code sign"
  )
  parser.add_argument(
      "--directory_to_sign", type=str, action="append", help="full file system "
      "paths to a directory to code sign, if the directory doesn't exist this "
      "script will do nothing"
  )
  parser.add_argument(
      "--mobileprovision", type=str, help="mobileprovision file")
  parser.add_argument(
      "--codesign", required=True, type=str, help="path to codesign binary")
  parser.add_argument(
      "--identity", type=str, help="specific identity to sign with")
  parser.add_argument(
      "--signed_path", type=str, action="append", help="a path that has "
      "already been signed"
  )
  parser.add_argument(
      "--entitlements", type=str, help="file with entitlement data to forward "
      "to the code signing tool"
  )
  parser.add_argument(
      "--force", action="store_true", help="replace any existing signature on "
      "the path(s) given"
  )
  parser.add_argument(
      "--disable_timestamp", action="store_true", help="disables the use of "
      "timestamp services"
  )
  parser.add_argument("extra", nargs = argparse.REMAINDER, help="additional "
      "arguments that go directly to codesign, starting with a '--' argument")
  return parser