def main(args=None): initialize_logging() initialize_user_dir() logfile = ConfigLoader().config.All.Logfile if logfile is not None: log_to_logfile(logfile) parser = ArgParser(description="Hydrant: a tool which aims to "\ "simplify and accelerate the development and maintenance of workflows"\ " for FireCloud (FC).") parser.add_argument('-V', '--version', action='version', version='%(prog)s ' + __version__) subparsers = parser.add_subparsers(dest='subcmd') subparsers.required = True install_commands(subparsers, ['init', 'build', 'push', 'validate', 'test']) install_commands(subparsers, ['tutorial', 'sync', 'install', 'config']) args, argv = parser.parse_known_args(args) args.func(argv)
'--config', type=task_config, help='Config file with [Task <task_name>] sections ' + 'that may contain Src=<path/to/src>, ' + 'Image=<[registry/]namespcae/repo[:tag]>, and ' + 'any [Docker] section arguments to initialize ' + 'tasks with specified names, then copy source ' + "code to each task's src directory and " + "initialize each task's hydrant.cfg, or " + 'initialize WDL with prexisting docker image(s)') parser.add_argument('workflow', type=new_folder, help='Name of template folder') parser.add_argument('task', nargs='*', type=user_task, help='Name of existing locally written task to ' + 'initialize with in the format of ' + '<workflow>.<task|*>, with "<workflow>.*" ' + 'indicating all tasks in <workflow>') args = parser.parse_args(args) user_tasks = process_user_tasks(args.task, args.workflow) generate_workflow(args.workflow, args.num_tasks, user_tasks, args.config or ConfigLoader().config, args.package) if __name__ == '__main__': initialize_logging() main()