#NEWLINE# def console_output( self , targets ) : #NEWLINE# #INDENT# if targets : #NEWLINE# #INDENT# raise TaskError ( 'This task does not accept any target addresses.' ) #NEWLINE# #UNINDENT# cmd_line_scopes = sorted ( self . get_all_cmd_line_scopes ( ) ) #NEWLINE# autocomplete_options_by_scope = self . get_autocomplete_options_by_scope ( ) #NEWLINE# def bash_scope_key( scope ) : #NEWLINE# #INDENT# if ( scope == GLOBAL_SCOPE ) : #NEWLINE# #INDENT# return '__pants_global_options' #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# return '__pants_options_for_{}' . format ( scope . replace ( '-' , '_' ) . replace ( '.' , '_' ) ) #NEWLINE# #UNINDENT# #UNINDENT# options_text_lines = [ ] #NEWLINE# for scope in cmd_line_scopes : #NEWLINE# #INDENT# options_text_lines . append ( "{}='{}'" . format ( bash_scope_key ( scope ) , ' ' . join ( autocomplete_options_by_scope [ scope ] ) ) ) #NEWLINE# #UNINDENT# options_text = '\n' . join ( options_text_lines ) #NEWLINE# generator = Generator ( resource_string ( __name__ , os . path . join ( 'templates' , 'bash_completion' , 'autocomplete.sh.mustache' ) ) , scopes_text = ' ' . join ( sorted ( list ( cmd_line_scopes ) ) ) , options_text = options_text ) #NEWLINE# for line in generator . render ( ) . split ( '\n' ) : #NEWLINE# #INDENT# ( yield line )