def format_options(self, ctx, formatter):
field_opts = []<EOL>global_opts = []<EOL>local_opts = []<EOL>other_opts = []<EOL>for param in self.params:<EOL><INDENT>if param.name in SETTINGS_PARMS:<EOL><INDENT>opts = global_opts<EOL><DEDENT>elif getattr(param, '<STR_LIT>', None) and param.help.startswith('<STR_LIT>'):<EOL><INDENT>opts = field_opts<EOL>param.help = param.help[len('<STR_LIT>'):]<EOL><DEDENT>else:<EOL><INDENT>opts = local_opts<EOL><DEDENT>rv = param.get_help_record(ctx)<EOL>if rv is None:<EOL><INDENT>continue<EOL><DEDENT>else:<EOL><INDENT>opts.append(rv)<EOL><DEDENT><DEDENT>if self.add_help_option:<EOL><INDENT>help_options = self.get_help_option_names(ctx)<EOL>if help_options:<EOL><INDENT>other_opts.append([join_options(help_options)[<NUM_LIT:0>], '<STR_LIT>'])<EOL><DEDENT><DEDENT>if field_opts:<EOL><INDENT>with formatter.section('<STR_LIT>'):<EOL><INDENT>formatter.write_dl(field_opts)<EOL><DEDENT><DEDENT>if local_opts:<EOL><INDENT>with formatter.section('<STR_LIT>'):<EOL><INDENT>formatter.write_dl(local_opts)<EOL><DEDENT><DEDENT>if global_opts:<EOL><INDENT>with formatter.section('<STR_LIT>'):<EOL><INDENT>formatter.write_dl(global_opts)<EOL><DEDENT><DEDENT>if other_opts:<EOL><INDENT>with formatter.section('<STR_LIT>'):<EOL><INDENT>formatter.write_dl(other_opts)<EOL><DEDENT><DEDENT>
Monkey-patch click's format_options method to support option categorization.