#NEWLINE# def logjoin_parse_args( ) : #NEWLINE# #INDENT# usage = '%prog -f <field> -d <delimiter_character> -t <timestamp_format_string>' #NEWLINE# parser = OptionParser ( usage = usage ) #NEWLINE# parser . add_option ( '-f' , '--field' , dest = 'field' , type = int , help = 'Index of field to use as field to join on' ) #NEWLINE# parser . add_option ( '-d' , '--delimiter' , dest = 'delimiter' , help = 'Delimiter character for field-separation' ) #NEWLINE# parser . add_option ( '-b' , '--backend' , dest = 'backend' , help = "Backend to use for joining. Currently available backends: 'sqlalchemy'" ) #NEWLINE# parser . add_option ( '-C' , '--join-connect-string' , dest = 'join_connect_string' , help = 'Connection string (e.g sqlalchemy db URI)' ) #NEWLINE# parser . add_option ( '-F' , '--join-remote-fields' , dest = 'join_remote_fields' , help = 'Fields to include from right join clause' ) #NEWLINE# parser . add_option ( '-N' , '--join-remote-name' , dest = 'join_remote_name' , help = 'Name of resource to join to (e.g file name, table name)' ) #NEWLINE# parser . add_option ( '-K' , '--join-remote-key' , dest = 'join_remote_key' , help = 'Name of remote key field to join on (e.g table field, file column index)' ) #NEWLINE# parser . add_option ( '-P' , '--profile' , dest = 'profile' , default = 'qps' , help = 'Configuration profile (section in configuration file)' ) #NEWLINE# ( options , args ) = parser . parse_args ( ) #NEWLINE# options . field = interpolate_config ( options . field , options . profile , 'field' , type = int ) #NEWLINE# options . delimiter = interpolate_config ( options . delimiter , options . profile , 'delimiter' , default = ' ' ) #NEWLINE# options . backend = interpolate_config ( options . backend , options . profile , 'backend' ) #NEWLINE# options . join_connect_string = interpolate_config ( options . join_connect_string , options . profile , 'join_connect_string' ) #NEWLINE# options . join_remote_fields = interpolate_config ( options . join_remote_fields , options . profile , 'join_remote_fields' ) #NEWLINE# options . join_remote_name = interpolate_config ( options . join_remote_name , options . profile , 'join_remote_name' ) #NEWLINE# options . join_remote_key = interpolate_config ( options . join_remote_key , options . profile , 'join_remote_key' ) #NEWLINE# return ( AttrDict ( options . __dict__ ) , args )