def parse_args()

in reference/src/main/python/similar.py [0:0]


def parse_args():
    parser = argparse.ArgumentParser()

    parser.add_argument(
        "-c",
        "--corpus",
        action="store",
        dest="corpus",
        default=None,
        help="Process raw ASTs, featurize, and store in the working directory.",
    )
    parser.add_argument(
        "-d",
        "--working-dir",
        action="store",
        dest="working_dir",
        help="Working directory.",
        required=True,
    )
    parser.add_argument(
        "-f",
        "--file-query",
        action="append",
        dest="file_query",
        default=[],
        help="File containing the query AST of a query code as JSON.",
    )
    parser.add_argument(
        "-k",
        "--keywords",
        action="append",
        dest="keywords",
        default=[],
        help="Keywords to search for.",
    )
    parser.add_argument(
        "-i",
        "--index-query",
        type=int,
        action="store",
        dest="index_query",
        default=None,
        help="Index of the query AST in the corpus.",
    )
    parser.add_argument(
        "-t",
        "--testall",
        dest="testall",
        action="store_true",
        default=False,
        help="Sample config.N_SAMPLES snippets and search.",
    )
    options = parser.parse_args()
    logging.info(options)
    return options