Add the github jenkins hook command and arguments.

    :rtype: argparse.ArgumentParser
186864
def add_github_hook_options(parser):
    
    cookbook = parser.add_parser('github', help='Install the Jenkins callback '
                                                'hook in a GitHub repository')
    cookbook.add_argument('owner', action='store',
                          help='The owner of the GitHub repo')
    cookbook.add_argument('repo', action='store',
                          help='The GitHub repository name')
    domain = socket.gethostname()
    example = 'jenkins.%s' % domain
    cookbook.add_argument('jenkins_hook_url', action='store',
                          help='The jenkins hook URL. For example %s' % example)

    cookbook.add_argument('-g', '--github-host',
                          action='store',
                          dest='github',
                          default=github.GITHUB_HOST,
                          help='Override github.com for a '
                               'GitHub::Enterprise host')
    cookbook.add_argument('-u', '--username',
                          action='store',
                          dest='username',
                          help='Specify a different username than the repo '
                               'owner')

    cookbook.set_defaults(func='github_hooks')
1267396
def add_arguments(parser):
    
    parser.description = 'Examples:\n' \
                         'python -m etk html_content_extractor /tmp/input.html\n' \
                         'cat /tmp/input.html | python -m etk html_content_extractor'
    parser.add_argument('input_file', nargs='?', type=argparse.FileType('r'), default=sys.stdin)
1122461
def add_argument(*args, **kwargs):
    

    def decorator(func):
        func = ScriptAdaptor._wrap(func)
        func._add_argument(args, kwargs)
        return func
    return decorator
568422
def setup_argparse():
    
    parser = argparse.ArgumentParser(
        description='Convert old ini-style GNS3 topologies (<=0.8.7) to '
                    'the newer version 1+ JSON format')
    parser.add_argument('--version',
                        action='version',
                        version='%(prog)s ' + __version__)
    parser.add_argument('-n', '--name', help='Topology name (default uses the '
                                             'name of the old project '
                                             'directory)')
    parser.add_argument('-o', '--output', help='Output directory')
    parser.add_argument('topology', nargs='?', default='topology.net',
                        help='GNS3 .net topology file (default: topology.net)')
    parser.add_argument('--debug',
                        help='Enable debugging output',
                        action='store_true')
    parser.add_argument('-q', '--quiet',
                        help='Quiet-mode (no output to console)',
                        action='store_true')
    return parser
599093
def add_parser_arguments():
    """"""
    argparser = parser.get()
    argparser.add_argument('-P', '--profile',
                           action='store',
                           default=None,
                           dest='profile',
                           help='Profile the consumer modules, specifying '
                           'the output directory.')
    argparser.add_argument('-o', '--only',
                           action='store',
                           default=None,
                           dest='consumer',
                           help='Only run the consumer specified')
    argparser.add_argument('-p', '--prepend-path',
                           action='store',
                           default=None,
                           dest='prepend_path',
                           help='Prepend the python path with the value.')
    argparser.add_argument('-q', '--qty',
                           action='store',
                           type=int,
                           default=None,
                           dest='quantity',
                           help='Run the specified quantity of consumer '
                           'processes when used in conjunction with -o')
    argparser.add_argument('--version', action='version',
                           version='%(prog)s {}'.format(__version__))
1332067
def add_gnu_argument(self, *args, **kwargs):
    ""

    gnu_args = []

    for arg in args:
        # Fix if we have at least 3 chars where the first is a hyphen
        # and the second is not a hyphen (e.g. -op becomes --op)
        if len(arg) > 3 and arg[0] == '-' and arg[1] != '-':
            gnu_args.append('-' + arg)
        else:
            gnu_args.append(arg)

    argparse.ArgumentParser.add_argument(self, *gnu_args, **kwargs)
258623
def _build_arguments(self):
        
        self._parser.add_argument(
            '--clean',
            type=bool,
            required=False,
            default=False,
            help="clean up everything that was created by freight forwarder at the end."
        )

        self._parser.add_argument(
            '--configs',
            type=bool,
            required=False,
            default=False,
            help="Would you like to inject configuration files?"
        )

        self._parser.add_argument(
            '--test',
            type=bool,
            required=False,
            default=False,
            help="Run tests."
        )

        self._parser.add_argument(
            '-t', '--tag',
            required=False,
            type=six.text_type,
            action='append',
            help='list of tags applied to the image being exported. example: sh1hash'
        )

        self._parser.add_argument(
            '--use-cache',
            required=False,
            action='store_true',
            default=False,
            help='Allow build to use cached image layers.'
        )

        self._parser.add_argument(
            '--no-tagging-scheme',
            required=False,
            action='store_true',
            default=False,
            help='Turn off freight forwarders tagging scheme.'
        )

        self._parser.add_argument(
            '--no-validation',
            action="store_true",
            required=False,
            default=False,
            help='**UNSAFE**. The image will be built, NOT started, and pushed to the registry'
        )

        self._parser.add_argument(
            '-y',
            required=False,
            action='store_true',
            default=False,
            help='**UNSAFE**. Turn off `--no-validation` interaction during export'
        )
548812
def add_arguments(parser):
    
    parser.description = 'Examples:\n' \
                         'python -m etk regex_extractor pattern /tmp/date.txt\n' \
                         'cat /tmp/date.txt | python -m etk regex_extractor pattern'
    parser.add_argument('pattern', nargs='?', type=str, default=sys.stdin)
    parser.add_argument('input_file', nargs='?', type=argparse.FileType('r'), default=sys.stdin)
1253529
def parse_args_and_run():
    
    parser = argparse.ArgumentParser()
    subparsers = parser.add_subparsers(help='Docker-tag-naming sub-commands',
                                       dest='subparser_name')

    #
    #   Forge
    #
    parser_forge = subparsers.add_parser('forge',
                                         help='Create a new version tag')
    parser_forge.add_argument('--version', type=int, default=1,
                              help='Version number')
    parser_forge.add_argument('--commit-id', required=True,
                              help='Git commit id')
    parser_forge.add_argument('--branch', required=True,
                              help='The branch name (ie. master)')

    #
    #   Latest
    #
    parser_latest = subparsers.add_parser('latest',
                                          help='Query the latest tag in the'
                                               ' registry')
    parser_latest.add_argument('image',
                               help='The image to query (ie. username/image)')
    parser_latest.add_argument('branch',
                               help='The branch name (ie. master)')

    #
    #   Bump
    #
    parser_bump = subparsers.add_parser('bump',
                                        help='Query the latest tag in the'
                                             ' registry and return a +1')
    parser_bump.add_argument('image',
                             help='The image to bump (ie. username/image)')
    parser_bump.add_argument('branch',
                             help='The branch name (ie. master)')
    parser_bump.add_argument('--commit-id', required=True,
                             help='Git commit id for the newly created tag')

    #
    #   Refresh
    #
    parser_latest = subparsers.add_parser('refresh',
                                          help='Loop until the latest tag in'
                                               ' the registry changes')
    parser_latest.add_argument('image',
                               help='The image to query (ie. username/image)')
    parser_latest.add_argument('branch',
                               help='The branch name (ie. master)')

    args = parser.parse_args()

    {'bump': run_bump,
     'latest': run_latest,
     'forge': run_forge,
     'refresh': run_refresh}.get(args.subparser_name)(args)
610618
def _fill_argparser(self, parser):
        
        for key, val in self._options.items():
            add_argument(parser, key, val)
1115555
def add_arguments(self, parser):
        """"""
        # Add the underlying test command arguments first
        test_command = TestCommand()
        test_command.add_arguments(parser)

        for option in OPTIONS:
            parser.add_argument(*option[0], **option[1])
825315
def _build_arguments(self):
        
        self._parser.add_argument(
            'image_name',
            metavar='IMAGE_NAME',
            type=six.text_type,
            help='Name of the image example: \"namespace/repository\"'
        )
309147
def add_arguments(cls, parser, sys_arg_list=None):
        
        parser.add_argument('-f', '--file', dest='file', required=True,
                            help="config file for routing groups "
                                 "(only in configfile mode)")
        return ["file"]
679220
def _parse_args(args: List[str]) -> _UpdateArgumentsRunConfig:
    
    parser = argparse.ArgumentParser(
        prog="gitlab-update-variables", description="Tool for setting a GitLab project's build variables")
    add_common_arguments(parser)
    parser.add_argument("config_location", type=str, help="Location of the configuration file")
    parser.add_argument("--setting-repository", dest="setting_repository", nargs="+", type=str,
                        help="Directory from which variable settings groups may be sourced")
    parser.add_argument("--default-setting-extension", dest="default_setting_extensions",nargs="+", type=str,
                        help="Extensions to try adding to the variable to source location if it does not exist")

    arguments = parser.parse_args(args)
    return _UpdateArgumentsRunConfig(
        arguments.config_location, arguments.setting_repository, arguments.default_setting_extensions,
        url=arguments.url, token=arguments.token, debug=arguments.debug)
1271777
def _build_arguments(self):
        
        self._parser.add_argument(
            '--attach',
            type=bool,
            required=False,
            default=False,
            help="Attach to containers output?"
        )

        self._parser.add_argument(
            '--clean',
            type=bool,
            required=False,
            default=False,
            help="clean up everything that was created by freight forwarder at the end."
        )

        self._parser.add_argument(
            '--configs',
            type=bool,
            required=False,
            default=False,
            help="Would you like to inject configuration files?"
        )

        self._parser.add_argument(
            '-e', '--env',
            required=False,
            type=str,
            action='append',
            default=None,
            help='environment variables to create in the container at run time.'
        )

        self._parser.add_argument(
            '--test',
            type=bool,
            required=False,
            default=False,
            help="Run tests."
        )

        self._parser.add_argument(
            '--use-cache',
            required=False,
            action='store_true',
            default=False,
            help='Allow build to use cached image layers.'
        )
304254
def add_arguments(self, parser):
        
        parser.add_argument('-p', '--product', action='store_true',
                            help='print the production information')
        parser.add_argument('-j', '--jtag', action='store_true',
                            help='print the JTAG pin status')
        return self.add_common_arguments(parser, False)
822695
def add_argument(self, parser, set_default=False):
        
        default = self.default if set_default else None
        kwargs = dict(
            nargs=self.nargs,
            default=default,
            help="%s [%s]" % (self.short, default)
        )
        kwargs.update(self.extra)
        if self.flags:
            args = tuple(self.flags)
            kwargs.update({'dest': self.name,
                           'action': self.action or "store"})
            if kwargs["action"] != "store":
                kwargs.pop("type", None)
                kwargs.pop("nargs", None)
        elif self.nargs and self.name:
            args = (self.name,)
            kwargs.update({'metavar': self.meta or None})
        else:
            # Not added to argparser
            return
        if self.meta:
            kwargs['metavar'] = self.meta
        parser.add_argument(*args, **kwargs)