#NEWLINE# def main( ) : #NEWLINE# #INDENT# ' the entry point for all things giftwrap ' #NEWLINE# parser = argparse . ArgumentParser ( ) #NEWLINE# parser . add_argument ( '-d' , '--debug' , action = 'store_true' , help = 'Set logging level to DEBUG' ) #NEWLINE# subparsers = parser . add_subparsers ( title = 'subcommands' , description = 'valid subcommands' , help = 'additional help' ) #NEWLINE# build_subcmd = subparsers . add_parser ( 'build' , description = 'build giftwrap packages' ) #NEWLINE# build_subcmd . add_argument ( '-m' , '--manifest' , required = True ) #NEWLINE# build_subcmd . add_argument ( '-v' , '--version' ) #NEWLINE# build_subcmd . add_argument ( '-t' , '--type' , choices = Builder . builder_names ( ) , required = True ) #NEWLINE# build_subcmd . add_argument ( '-s' , '--synchronous' , dest = 'parallel' , action = 'store_false' ) #NEWLINE# def csvarg( arg ) : #NEWLINE# #INDENT# if ( arg is not None ) : #NEWLINE# #INDENT# return arg . split ( ',' ) #NEWLINE# #UNINDENT# #UNINDENT# build_subcmd . add_argument ( '-p' , '--projects' , type = csvarg , dest = 'projects' ) #NEWLINE# build_subcmd . set_defaults ( func = build ) #NEWLINE# args = parser . parse_args ( ) #NEWLINE# log_level = logging . INFO #NEWLINE# if args . debug : #NEWLINE# #INDENT# log_level = logging . DEBUG #NEWLINE# #UNINDENT# _setup_logger ( log_level ) #NEWLINE# args . func ( args )