contrib/jwrapper: intro an option to choose the extern class name prefix
authorAlexis Laferrière <alexis.laf@xymus.net>
Thu, 23 Jul 2015 13:22:35 +0000 (09:22 -0400)
committerAlexis Laferrière <alexis.laf@xymus.net>
Fri, 24 Jul 2015 13:44:25 +0000 (09:44 -0400)
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

contrib/jwrapper/src/jwrapper.nit
contrib/jwrapper/src/model.nit

index aeba9c3..2f36904 100644 (file)
@@ -43,7 +43,7 @@ var opt_verbose = new OptionCount("Verbosity", "-v")
 var opt_output = new OptionString("Output file", "-o")
 var opt_help = new OptionBool("Show this help message", "-h", "--help")
 
-opts.add_option(opt_output, opt_unknown, opt_verbose, opt_help)
+opts.add_option(opt_output, opt_unknown, opt_extern_class_prefix, opt_verbose, opt_help)
 opts.parse args
 
 if opts.errors.not_empty or opts.rest.is_empty or opt_help.value then
index 6200f28..c25e9e2 100644 (file)
@@ -19,6 +19,7 @@
 module model
 
 import more_collections
+import opts
 
 import jtype_converter
 
@@ -297,4 +298,10 @@ redef class Sys
 
                return map
        end
+
+       # Option to set `extern_class_prefix`
+       var opt_extern_class_prefix = new OptionString("Prefix to extern classes (By default uses the full namespace)", "-p")
+
+       # Prefix used to name extern classes, if `null` use the full namespace
+       var extern_class_prefix: nullable String is lazy do return opt_extern_class_prefix.value
 end