<commit_before>#!/bin/python3

import os
import shutil
import argparse

import re



def main():
    littleRISCV_path = os.path.abspath(os.path.dirname(os.path.realpath(__file__)) + "/..")  # Path to littleRISCV folder
    print(littleRISCV_path)

    parser = argparse.ArgumentParser(description="Can overwrite config and export clean version of littleRISCV")
    parser.add_argument('-i', dest="new_riscv_config", metavar='.../new_riscv_config.sv',
                        help='path to a new config file to overwrite littleRISCV config')
    parser.add_argument('-o', dest='build_folder_path', metavar='.../build_folder_path',
                        help='path to a folder to export clean version of littleRISCV without preprocessor switches')
    parser.add_argument('-z', dest='zip', action='store_true',
                        help='zip the export into a tar.gz')
    args = parser.parse_args()

    action_taken = False

    if args.new_riscv_config is not None:
        overwriteConfig(args["new_riscv_config.sv"], littleRISCV_path)
        action_taken = True

    if args.build_folder_path is not None:
        exportCleanVersion(args.build_folder_path, littleRISCV_path, zip=args.zip)
        action_taken = True

    if action_taken == False:
        print("No action taken. Please see the help below for more information:")
        parser.print_help()





def overwriteConfig(new_config_path, littleRISCV_path):
    print("Overwriting current config (include/riscv_config.sv) with new one.")
    shutil.move(os.path.abspath(littleRISCV_path + "/include/riscv_config.sv"), os.path.abspath(littleRISCV_path + "/include/riscv_config.sv.bak")) # Backup
    shutil.copy(os.path.abspath(new_config_path), os.path.abspath(littleRISCV_path + "/include/riscv_config.sv")) # Copy new config to littleRISCV


def parseConfig(littleRISCV_path):
    print("Trying to parse configuration.")
    definitions = []
    config = os.path.abspath(littleRISCV_path + "/include/riscv_config.sv")
<commit_msg>Rename export parameter in help of ri5cly-manage.py<commit_after>#!/bin/python3

import os
import shutil
import argparse

import re



def main():
    littleRISCV_path = os.path.abspath(os.path.dirname(os.path.realpath(__file__)) + "/..")  # Path to littleRISCV folder
    print(littleRISCV_path)

    parser = argparse.ArgumentParser(description="Can overwrite config and export clean version of littleRISCV")
    parser.add_argument('-i', dest="new_riscv_config", metavar='.../new_riscv_config.sv',
                        help='path to a new config file to overwrite littleRISCV config')
    parser.add_argument('-o', dest='export_folder_path', metavar='.../export_folder_path',
                        help='path to a folder to export clean version of littleRISCV without preprocessor switches')
    parser.add_argument('-z', dest='zip', action='store_true',
                        help='zip the export into a tar.gz')
    args = parser.parse_args()

    action_taken = False

    if args.new_riscv_config is not None:
        overwriteConfig(args["new_riscv_config.sv"], littleRISCV_path)
        action_taken = True

    if args.export_folder_path is not None:
        exportCleanVersion(args.export_folder_path, littleRISCV_path, zip=args.zip)
        action_taken = True

    if action_taken == False:
        print("No action taken. Please see the help below for more information:")
        parser.print_help()





def overwriteConfig(new_config_path, littleRISCV_path):
    print("Overwriting current config (include/riscv_config.sv) with new one.")
    shutil.move(os.path.abspath(littleRISCV_path + "/include/riscv_config.sv"), os.path.abspath(littleRISCV_path + "/include/riscv_config.sv.bak")) # Backup
    shutil.copy(os.path.abspath(new_config_path), os.path.abspath(littleRISCV_path + "/include/riscv_config.sv")) # Copy new config to littleRISCV


def parseConfig(littleRISCV_path):
    print("Trying to parse configuration.")
    definitions = []
    config = os.path.abspath(littleRISCV_path + "/include/riscv_config.sv")

{'fraction_non_alphanumeric': 0.10973801285219971, 'fraction_numerical': 0.0007414730598121602, 'mean_word_length': 3.6894553881807646, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2453649', 'n_tokens_mistral': 1316, 'n_tokens_neox': 1272, 'n_words': 280}