#NEWLINE# def parse_global_options( context , argv ) : #NEWLINE# #INDENT# ( global_args , cmd_args ) = ( [ ] , [ ] ) #NEWLINE# for ( i , a ) in enumerate ( argv ) : #NEWLINE# #INDENT# if a . startswith ( '-' ) : #NEWLINE# #INDENT# global_args . append ( a ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# cmd_args = argv [ i : ] #NEWLINE# break #NEWLINE# #UNINDENT# #UNINDENT# cmd_name = None #NEWLINE# cmd_argv = None #NEWLINE# if cmd_args : #NEWLINE# #INDENT# cmd_name = cmd_args [ 0 ] #NEWLINE# cmd_argv = cmd_args [ 1 : ] #NEWLINE# #UNINDENT# ( o , a ) = context . parser . parse_args ( global_args ) #NEWLINE# show_usage = o . show_help #NEWLINE# build_directory = o . build_directory #NEWLINE# if ( not ( os . path . basename ( o . bento_info ) == BENTO_SCRIPT ) ) : #NEWLINE# #INDENT# context . parser . error ( ( 'Invalid value for --bento-info: %r (basename should be %r)' % ( o . bento_info , BENTO_SCRIPT ) ) ) #NEWLINE# #UNINDENT# bento_info = o . bento_info #NEWLINE# show_version = o . show_version #NEWLINE# show_full_version = o . show_full_version #NEWLINE# global_options = GlobalOptions ( cmd_name , cmd_argv , show_usage , build_directory , bento_info , show_version , show_full_version , o . disable_autoconfigure ) #NEWLINE# return global_options