[STRIP_SUFFIX] ability to flag suffixes to be stripped.
[gnome.gobject-introspection] / giscanner / scannermain.py
index 44c0287..6ef80ee 100644 (file)
@@ -75,6 +75,10 @@ def _get_option_parser():
     parser.add_option("", "--strip-prefix",
                       action="store", dest="strip_prefix", default=None,
                       help="remove this prefix from objects and functions")
+    parser.add_option("", "--strip-suffix",
+                      action="store", dest="strip_suffix", default=None,
+                      help="remove this suffix from objects and functions, "
+                           "only done when also removing prefix")
     parser.add_option("", "--add-init-section",
                       action="append", dest="init_sections", default=[],
             help="add extra initialization code in the introspection program")
@@ -271,6 +275,7 @@ def scanner_main(args):
         transformer.set_strip_prefix(options.strip_prefix)
     else:
         transformer.set_strip_prefix(options.namespace_name)
+    transformer.set_strip_suffix(options.strip_suffix)        
     transformer.set_include_paths(options.include_paths)
     shown_include_warning = False
     for include in options.includes: