File indexing completed on 2024-12-08 11:05:22
0001 """ 0002 Module containing classes for the fork command 0003 """ 0004 0005 # SPDX-FileCopyrightText: 2020 Jonah BrĂ¼chert <jbb@kaidan.im> 0006 # 0007 # SPDX-License-Identifier: GPL-2.0-or-later 0008 0009 import argparse 0010 0011 from lab.mergerequestcreator import MergeRequestCreator 0012 0013 0014 def parser( 0015 subparsers: argparse._SubParsersAction, # pylint: disable=protected-access 0016 ) -> argparse.ArgumentParser: 0017 """ 0018 Subparser for fork command 0019 :param subparsers: subparsers object from global parser 0020 :return: fork subparser 0021 """ 0022 fork_parser: argparse.ArgumentParser = subparsers.add_parser( 0023 "fork", help="Create a fork of the project" 0024 ) 0025 return fork_parser 0026 0027 0028 def run(args: argparse.Namespace) -> None: # pylint: disable=unused-argument 0029 """ 0030 run fork command 0031 :param args: parsed arguments 0032 """ 0033 creator: MergeRequestCreator = MergeRequestCreator("master", True) 0034 creator.fork()