mirror of
https://github.com/Mbed-TLS/mbedtls.git
synced 2025-03-14 07:20:52 +00:00
generate_test_keys: add default output file option
Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
This commit is contained in:
parent
4b9aebf4d9
commit
b627199d60
@ -91,14 +91,16 @@ def get_look_up_table_entry(key_type: str, group_id_or_keybits: str,
|
||||
yield " {0}, sizeof({0}) }},".format(pub_array_name)
|
||||
|
||||
def main() -> None:
|
||||
current_path = os.path.dirname(os.path.realpath(__file__))
|
||||
default_output_path = current_path + "/../src/test_keys.h"
|
||||
|
||||
argparser = argparse.ArgumentParser()
|
||||
argparser.add_argument("--output", required=True, help="Output file")
|
||||
argparser.add_argument("--output", help="Output file", default=default_output_path)
|
||||
args = argparser.parse_args()
|
||||
|
||||
output_file = args.output
|
||||
# Remove output file if already existing.
|
||||
if os.path.exists(output_file):
|
||||
print("Warning: {} already existing, it will be overwritten.", output_file)
|
||||
os.remove(output_file)
|
||||
|
||||
output_file = open(output_file, 'at')
|
||||
|
Loading…
x
Reference in New Issue
Block a user