def parse_opts()

in tools/manifest.py [0:0]


def parse_opts():
    parser = ArgumentParser(prog="manifest.py")

    parser.add_argument(
        dest="mode",
        choices=["tags", "manifest"],
        type=str,
        help="The print mode of script",
    )

    parser.add_argument(
        "-p",
        "--path",
        type=str,
        help="The path to specific dockerfile",
    )

    parser.add_argument(
        "-i",
        "--image",
        type=str,
        help="The complete image registry url (such as `apache/spark`)",
    )

    parser.add_argument(
        "-f",
        "--file",
        type=str,
        default="versions.json",
        help="The version json of image meta.",
    )

    args, unknown = parser.parse_known_args()
    if unknown:
        parser.error("Unsupported arguments: %s" % " ".join(unknown))
    return args