#NEWLINE# def addOptions( parser , config = Config ( ) ) : #NEWLINE# #INDENT# '\n    Adds toil options to a parser object, either optparse or argparse.\n    ' #NEWLINE# addLoggingOptions ( parser ) #NEWLINE# if isinstance ( parser , ArgumentParser ) : #NEWLINE# #INDENT# def addGroup( headingString , bodyString ) : #NEWLINE# #INDENT# return parser . add_argument_group ( headingString , bodyString ) . add_argument #NEWLINE# #UNINDENT# _addOptions ( addGroup , config ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# raise RuntimeError ( ( 'Unanticipated class passed to addOptions(), %s. Expecting argparse.ArgumentParser' % parser . __class__ ) )