#!/usr/bin/env python3
# -*- coding: utf-8 -*-

'''
This script simply uses the Manager class to extract the settings of a simulation.
'''

import argparse
import json

from hateno.manager import Manager

def addArguments(parser):
    parser.add_argument('folder_path', type = str, help = 'path to the managed folder')
    parser.add_argument('simulation_id', type = str, help = 'identifier of the simulation (name or hashed settings)')

def action(args):
    manager = Manager(args.folder_path)

    settings = manager.settingsOf(args.simulation_id)
    print(json.dumps(settings, indent = '\t'))

if __name__ == '__main__':
    parser = argparse.ArgumentParser(description = 'Extract the settings of a simulation.')
    addArguments(parser)
    action(parser.parse_args())
