summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorColin Walters <walters@src.gnome.org>2008-10-18 00:44:14 +0000
committerColin Walters <walters@src.gnome.org>2008-10-18 00:44:14 +0000
commitddba2d15b1d4dbe66fac09fb62e3d0b023492cf4 (patch)
tree22d3375522c432630d45e77cb5c3321debaf3679 /tools
parent708d9dc89f2b785ba33c3d5db3b4a93e355f62e4 (diff)
downloadgobject-introspection-ddba2d15b1d4dbe66fac09fb62e3d0b023492cf4.tar.gz
Bug 556783 - namespace/prefix rework
svn path=/trunk/; revision=746
Diffstat (limited to 'tools')
-rwxr-xr-xtools/g-ir-scanner11
1 files changed, 7 insertions, 4 deletions
diff --git a/tools/g-ir-scanner b/tools/g-ir-scanner
index 8c284f94..f1ad7eb2 100755
--- a/tools/g-ir-scanner
+++ b/tools/g-ir-scanner
@@ -62,13 +62,13 @@ def _get_option_parser():
help="directories to search for libraries")
parser.add_option("-n", "--namespace",
action="store", dest="namespace_name",
- help="name of namespace for this unit")
+ help="name of namespace for this unit, also used as --strip-prefix default")
parser.add_option("", "--nsversion",
action="store", dest="namespace_version",
help="version of namespace for this unit")
parser.add_option("", "--strip-prefix",
- action="store", dest="strip_prefix", default="",
- help="prefix to strip from functions, like g_")
+ action="store", dest="strip_prefix", default=None,
+ help="remove this prefix from objects and functions")
parser.add_option("-o", "--output",
action="store", dest="output",
help="output to writeout, defaults to stdout")
@@ -252,7 +252,10 @@ def main(args):
# Transform the C symbols into AST nodes
transformer = Transformer(ss, options.namespace_name, options.namespace_version)
- transformer.set_strip_prefix(options.strip_prefix)
+ if options.strip_prefix:
+ transformer.set_strip_prefix(options.strip_prefix)
+ else:
+ transformer.set_strip_prefix(options.namespace_name)
transformer.set_include_paths(options.include_paths)
shown_include_warning = False
for include in options.includes: