def base_parser()

in ftl/common/args.py [0:0]


def base_parser():
    parser = argparse.ArgumentParser()
    group = parser.add_mutually_exclusive_group(required=True)
    group.add_argument(
        '--base', action='store', help=('The name of the docker base image.'))
    group.add_argument(
        '--tar_base_image_path',
        dest='tar_base_image_path',
        action='store',
        default=None,
        help='The tar path for the base dockerimage for the FTL build')
    parser.add_argument(
        '--name',
        required=True,
        action='store',
        help=('The name of the docker image to push.'))
    parser.add_argument(
        '--directory',
        required=True,
        action='store',
        help='The path where the application data sits.')
    parser.add_argument(
        '--additional-directory',
        action='store',
        help='Additional \
        path whose contents gets appended to the final image.')
    parser.add_argument(
        '--cache-repository',
        action='store',
        required=False,
        help=('The name of the repository to use as the root for the cache.'))
    parser.add_argument(
        '--cache-key-version',
        action='store',
        required=False,
        default=constants.CACHE_KEY_VERSION,
        help=('A version value added to every cache key used by FTL'))
    parser.add_argument(
        '--cache-salt',
        action='store',
        required=False,
        default="",
        help=('A cache salt value added to every cache key used by FTL'))
    parser.add_argument(
        '--no-cache',
        dest='cache',
        action='store_false',
        help='Do not check cache during build.')
    parser.add_argument(
        '--cache',
        dest='cache',
        default=True,
        action='store_true',
        help='Check cache during build (default).')
    parser.add_argument(
        '--global-cache',
        dest='global_cache',
        default=False,
        action='store_true',
        help='Use global cache')
    parser.add_argument(
        '--export-cache-stats',
        dest='export_cache_stats',
        default=False,
        action='store_true',
        help='Export cache hit/miss stats')
    parser.add_argument(
        '--no-upload',
        dest='upload',
        action='store_false',
        help='Do not upload to cache during build.')
    parser.add_argument(
        '--upload',
        dest='upload',
        default=True,
        action='store_true',
        help='Upload to cache during build (default).')
    parser.add_argument(
        '--output-path',
        dest='output_path',
        action='store',
        help='Store final image as local tarball at output path \
            instead of pushing to registry')
    parser.add_argument(
        "-v",
        "--verbosity",
        default=constants.DEFAULT_LOG_LEVEL,
        nargs="?",
        action='store',
        choices=logger.LEVEL_MAP.keys())
    parser.add_argument(
        '--destination',
        dest='destination_path',
        action='store',
        default=constants.DEFAULT_DESTINATION_PATH,
        help='The base path that the app and dependency files will be \
        installed in the final image')
    parser.add_argument(
        '--entrypoint',
        dest='entrypoint',
        action='store',
        default=constants.DEFAULT_ENTRYPOINT,
        help='The entrypoint for the dockerimage')
    parser.add_argument(
        '--sh-c-prefix',
        dest='sh_c_prefix',
        action='store_true',
        default=False,
        help='If sh -c should be prepended to the entrypoint')
    parser.add_argument(
        '--succeed-on-error',
        dest='fail_on_error',
        action='store_false',
        default=True,
        help='If sh -c should be prepended to the entrypoint')
    parser.add_argument(
        '--exposed-ports',
        dest='exposed_ports',
        action='store',
        default=None,
        help='The port to expose for the dockerimage')
    parser.add_argument(
        '--builder-output-path',
        dest='builder_output_path',
        action='store',
        default=(os.environ.get(constants.BUILDER_OUTPUT)
                 if os.environ.get(constants.BUILDER_OUTPUT) else None),
        help='The path to store FTL logs')
    parser.add_argument(
        '--ttl',
        dest='ttl',
        action='store',
        default=constants.DEFAULT_TTL_HOURS,
        help='The TTL (in hours) set on the cached images that FTL creates')

    return parser