parser = argparse.ArgumentParser(description='Run the app')
skill_list = utils.read_yaml_file('skill_list.yml')
parser.add_argument('skill', choices=skill_list, help="Which skill?")
parser.add_argument('endpoints', default=None, help="Configuration file for the connectors as a yml file")
skill = parser.parse_args().skill
endpoints = parser.parse_args().endpoints
In the above code, I can pass two parameters to as follows:
run.py joke endpoints.yml
If my 'skill' is a variable list, meaning that I don't know how much arguments users might pass. In such a case, I can do:
run.py joke command weather endpoints.yml
Here "joke command weather" will be passed by the 'skill' argument. How can I do that?