Add verbose flag
This commit is contained in:
		
							parent
							
								
									261c8b6275
								
							
						
					
					
						commit
						e36e5a1428
					
				| 
						 | 
				
			
			@ -1,5 +1,6 @@
 | 
			
		|||
import argparse
 | 
			
		||||
import configparser
 | 
			
		||||
import logging
 | 
			
		||||
import traceback
 | 
			
		||||
import sys
 | 
			
		||||
from pathlib import Path
 | 
			
		||||
| 
						 | 
				
			
			@ -91,6 +92,9 @@ def main():
 | 
			
		|||
 | 
			
		||||
    # Build parser
 | 
			
		||||
    parser = argparse.ArgumentParser()
 | 
			
		||||
    parser.add_argument(
 | 
			
		||||
        '-v', '--verbose', action='store_true',
 | 
			
		||||
        help="Display informational messages.")
 | 
			
		||||
    parser.set_defaults(command=None)
 | 
			
		||||
    subparsers = parser.add_subparsers()
 | 
			
		||||
    for command in commands:
 | 
			
		||||
| 
						 | 
				
			
			@ -100,6 +104,8 @@ def main():
 | 
			
		|||
 | 
			
		||||
    # Run command
 | 
			
		||||
    args = parser.parse_args(args[1:])
 | 
			
		||||
    if args.verbose:
 | 
			
		||||
        logging.basicConfig(level=logging.DEBUG)
 | 
			
		||||
    if args.command is None:
 | 
			
		||||
        parser.print_usage()
 | 
			
		||||
    else:
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue