@cli.command()<EOL>@click.argument('<STR_LIT>', nargs=-<NUM_LIT:1>)<EOL>@click.option('<STR_LIT>', '<STR_LIT>', is_flag=True,<EOL>help='<STR_LIT>')<EOL>@click.option('<STR_LIT>', '<STR_LIT>', is_flag=True,<EOL>help='<STR_LIT>')<EOL>@click.pass_context<EOL>def export(context, keywords, module, update):
logging.info(_('<STR_LIT>'))<EOL>database = context.obj['<STR_LIT>']<EOL>none = True<EOL>if update:<EOL><INDENT>exports = OrderedDict()<EOL>from .executables.pe import PE<EOL>for filename in keywords:<EOL><INDENT>module = split_ext(filename, basename=True)[<NUM_LIT:0>]<EOL>with open(filename, '<STR_LIT:rb>') as stream:<EOL><INDENT>exports.update(<EOL>{module: PE(stream).get_export_table()})<EOL><DEDENT><DEDENT>database.make_export(exports)<EOL>none = False<EOL><DEDENT>elif module:<EOL><INDENT>for module_name in keywords:<EOL><INDENT>funcs = database.query_module_funcs(module_name)<EOL>if funcs:<EOL><INDENT>none = False<EOL>print('<STR_LIT:U+002CU+0020>'.join(map(str, funcs)))<EOL><DEDENT>else:<EOL><INDENT>logging.warning(_('<STR_LIT>'),<EOL>module_name)<EOL><DEDENT><DEDENT><DEDENT>else:<EOL><INDENT>for func_name in keywords:<EOL><INDENT>module_name = database.query_func_module(func_name)<EOL>if module_name:<EOL><INDENT>none = False<EOL>print(repr(module_name))<EOL><DEDENT>else:<EOL><INDENT>logging.warning(_('<STR_LIT>'),<EOL>func_name)<EOL><DEDENT><DEDENT><DEDENT>sys.exit(<NUM_LIT:1> if none else <NUM_LIT:0>)<EOL>
Operate on libraries and exported functions.

    Query the module name containing the function by default.

    Windows database must be prepared before using this.