summaryrefslogtreecommitdiff
path: root/giscanner/scannermain.py
diff options
context:
space:
mode:
authorGarrett Regier <garrett.regier@riftio.com>2015-02-14 11:15:50 -0800
committerColin Walters <walters@verbum.org>2015-04-20 16:47:36 -0400
commit7e5a553e7b597a7d53e901307c5f46a660b9c124 (patch)
tree3e8a4f49d66091ef28396492d0cddd506ed6e5f7 /giscanner/scannermain.py
parent564e3b1baf8cad0c08f88bef09bbb14272fd65e2 (diff)
downloadgobject-introspection-7e5a553e7b597a7d53e901307c5f46a660b9c124.tar.gz
scanner: Add --symbol-filter-cmd
Add the command line flag --symbol-filter-cmd to g-ir-scanner which allows running symbol names through a filtering shell command. The symbol is sent as stdin to the filter command and expects a filtered result written to stdout. https://bugzilla.gnome.org/show_bug.cgi?id=744534 Signed-off-by: Garrett Regier <garrett.regier@riftio.com>
Diffstat (limited to 'giscanner/scannermain.py')
-rwxr-xr-xgiscanner/scannermain.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/giscanner/scannermain.py b/giscanner/scannermain.py
index b36284da..6be958ed 100755
--- a/giscanner/scannermain.py
+++ b/giscanner/scannermain.py
@@ -164,6 +164,11 @@ the latter is not specified.""")
parser.add_option("", "--symbol-prefix",
action="append", dest="symbol_prefixes", default=[],
help="Remove this prefix from C symbols (function names)")
+ parser.add_option("", "--symbol-filter-cmd",
+ action="store", dest="symbol_filter_cmd", default='',
+ help='Filter symbols (function names) through the given '
+ 'shell command which will receive the symbol name as input '
+ 'to stdin and is expected to output the filtered results to stdout.')
parser.add_option("", "--accept-unprefixed",
action="store_true", dest="accept_unprefixed", default=False,
help="""If specified, accept symbols and identifiers that do not
@@ -367,7 +372,8 @@ see --identifier-prefix and --symbol-prefix."""
def create_transformer(namespace, options):
transformer = Transformer(namespace,
accept_unprefixed=options.accept_unprefixed,
- identifier_filter_cmd=options.identifier_filter_cmd)
+ identifier_filter_cmd=options.identifier_filter_cmd,
+ symbol_filter_cmd=options.symbol_filter_cmd)
transformer.set_include_paths(options.include_paths)
if options.passthrough_gir:
transformer.disable_cache()