| 727 | return {} |
| 728 | |
| 729 | def MakeOptions(self, args=None): |
| 730 | parser = argparse.ArgumentParser(description=self._Description()) |
| 731 | parser.add_argument("-a", "--author", default="", |
| 732 | help="The author email used for code review.") |
| 733 | parser.add_argument("--dry-run", default=False, action="store_true", |
| 734 | help="Perform only read-only actions.") |
| 735 | parser.add_argument("--json-output", |
| 736 | help="File to write results summary to.") |
| 737 | parser.add_argument("-r", "--reviewer", default="", |
| 738 | help="The account name to be used for reviews.") |
| 739 | parser.add_argument("--tbr-reviewer", "--tbr", default="", |
| 740 | help="The account name to be used for TBR reviews.") |
| 741 | parser.add_argument("-s", "--step", |
| 742 | help="Specify the step where to start work. Default: 0.", |
| 743 | default=0, type=int) |
| 744 | parser.add_argument("--work-dir", |
| 745 | help=("Location where to bootstrap a working v8 " |
| 746 | "checkout.")) |
| 747 | self._PrepareOptions(parser) |
| 748 | |
| 749 | if args is None: # pragma: no cover |
| 750 | options = parser.parse_args() |
| 751 | else: |
| 752 | options = parser.parse_args(args) |
| 753 | |
| 754 | # Process common options. |
| 755 | if options.step < 0: # pragma: no cover |
| 756 | print("Bad step number %d" % options.step) |
| 757 | parser.print_help() |
| 758 | return None |
| 759 | |
| 760 | # Defaults for options, common to all scripts. |
| 761 | options.manual = getattr(options, "manual", True) |
| 762 | options.force = getattr(options, "force", False) |
| 763 | options.bypass_upload_hooks = False |
| 764 | |
| 765 | # Derived options. |
| 766 | options.requires_editor = not options.force |
| 767 | options.wait_for_lgtm = not options.force |
| 768 | options.force_readline_defaults = not options.manual |
| 769 | options.force_upload = not options.manual |
| 770 | |
| 771 | # Process script specific options. |
| 772 | if not self._ProcessOptions(options): |
| 773 | parser.print_help() |
| 774 | return None |
| 775 | |
| 776 | if not options.work_dir: |
| 777 | options.work_dir = "/tmp/v8-release-scripts-work-dir" |
| 778 | return options |
| 779 | |
| 780 | def RunSteps(self, step_classes, args=None): |
| 781 | options = self.MakeOptions(args) |