summaryrefslogtreecommitdiff
path: root/giscanner/scannermain.py
diff options
context:
space:
mode:
authorSimon Feltman <sfeltman@src.gnome.org>2013-12-29 05:29:24 -0800
committerSimon Feltman <sfeltman@src.gnome.org>2014-06-03 13:06:32 -0700
commita882381f83f0acc6aaf7bfa03e1faa1c41a7ba00 (patch)
treeb697160893d04f93a805f6ddd82cd66758834409 /giscanner/scannermain.py
parentdd0af8ef0145b1b1a323b06206c8e5528c6f8e1c (diff)
downloadgobject-introspection-a882381f83f0acc6aaf7bfa03e1faa1c41a7ba00.tar.gz
scanner: Add --identifier-filter-cmd
Add the command line flag --identifier-filter-cmd to g-ir-scanner which allows running identifier names through a filtering shell command. The identifier is sent as stdin to the filter command and expects a filtered result written to stdout. https://bugzilla.gnome.org/show_bug.cgi?706898
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 98d56878..ac340305 100755
--- a/giscanner/scannermain.py
+++ b/giscanner/scannermain.py
@@ -156,6 +156,11 @@ and --symbol-prefix.""")
help="""Remove this prefix from C identifiers (structure typedefs, etc.).
May be specified multiple times. This is also used as the default for --symbol-prefix if
the latter is not specified.""")
+ parser.add_option("", "--identifier-filter-cmd",
+ action="store", dest="identifier_filter_cmd", default='',
+ help='Filter identifiers (struct and union typedefs) through the given '
+ 'shell command which will receive the identifier name as input '
+ 'to stdin and is expected to output the filtered results to stdout.')
parser.add_option("", "--symbol-prefix",
action="append", dest="symbol_prefixes", default=[],
help="Remove this prefix from C symbols (function names)")
@@ -334,7 +339,8 @@ see --identifier-prefix and --symbol-prefix."""
def create_transformer(namespace, options):
transformer = Transformer(namespace,
- accept_unprefixed=options.accept_unprefixed)
+ accept_unprefixed=options.accept_unprefixed,
+ identifier_filter_cmd=options.identifier_filter_cmd)
transformer.set_include_paths(options.include_paths)
if options.passthrough_gir:
transformer.disable_cache()