Some checks failed
		
		
	
	automlst.cli/pipeline/head There was a failure building this commit
				
			Added default MLST scheme Added multiple ways of defining a MLST scheme CSV output now shows database name for each scheme ID Now uses native argparse library for ensuring mutual exclusivity of arguments and whether or not one is required. Updated to use 0.13.* of engine
		
			
				
	
	
		
			42 lines
		
	
	
		
			1.3 KiB
		
	
	
	
		
			Python
		
	
	
	
	
	
			
		
		
	
	
			42 lines
		
	
	
		
			1.3 KiB
		
	
	
	
		
			Python
		
	
	
	
	
	
| import argparse
 | |
| from importlib import metadata
 | |
| from os import path
 | |
| import os
 | |
| 
 | |
| from autobigs.cli import info, st
 | |
| from autobigs.cli.meta import get_module_base_name
 | |
| import importlib
 | |
| 
 | |
| root_parser = argparse.ArgumentParser(epilog='Use "%(prog)s info -h" to learn how to get available MLST databases, and their available schemes.'
 | |
|                                       + ' Once that is done, use "%(prog)s st -h" to learn how to retrieve MLST profiles.'
 | |
|                                       )
 | |
| subparsers = root_parser.add_subparsers(required=False)
 | |
| 
 | |
| info.setup_parser(subparsers.add_parser(get_module_base_name(info.__name__)))
 | |
| st.setup_parser(subparsers.add_parser(get_module_base_name(st.__name__)))
 | |
| 
 | |
| root_parser.add_argument(
 | |
|     "--version",
 | |
|     action="store_true",
 | |
|     default=False,
 | |
|     required=False,
 | |
|     help="Displays the autoBIGS.cli version, and the autoBIGS.Engine version."
 | |
| )
 | |
| 
 | |
| 
 | |
| def run():
 | |
|     args = root_parser.parse_args()
 | |
|     if args.version:
 | |
|         print(f'autoBIGS.cli is running version {
 | |
|               metadata.version("autobigs-cli")}.')
 | |
|         print(f'autoBIGS.engine is running version {
 | |
|               metadata.version("autobigs-engine")}.')
 | |
|     if hasattr(args, "run"):
 | |
|         args.run(args)
 | |
|     elif not args.version:
 | |
|         root_parser.print_usage()
 | |
| 
 | |
| 
 | |
| if __name__ == "__main__":
 | |
|     run()
 |