Permalink
Browse files

[Utilities] add a rudimentary ability to dump header information from…

… the module
  • Loading branch information...
1 parent 2ac63b1 commit 0f6b18013d0ba57505db87a2200218e7442bc49a @Whiteknight committed Sep 4, 2012
Showing with 13 additions and 2 deletions.
  1. +13 −2 src/utilities/dump_pbc.winxed
@@ -8,7 +8,9 @@ function main[main](var args)
"class|c" : "Dump classes",
"namespace|n" : "Dump namespaces",
"function|f" : "Dump functions (implies -n)",
- "all|a" : "Dump everything"
+ "all|a" : "Dump everything",
+ "quiet|q" : "Print only requested items",
+ "header|e" : "Dump module header"
});
p.default_mode().set_function(dump_pbc_main);
p.add_mode("help").require_flag("h").set_function(usage_and_exit);
@@ -28,11 +30,20 @@ function dump_pbc_main(var args)
int dump_classes = dump_all || int(args["class"]);
int dump_namespaces = dump_all || int(args["namespace"]);
int dump_functions = dump_all || int(args["function"]);
+ int quiet = int(args["quiet"]); // TODO
+ int dump_header = dump_all || int(args["header"]);
- // TODO: Dump some header information in all modes
+ // We should be able to do something like:
+ // rosella_dump_pbc foo.pbc --quiet --classes | xargs rosella_test_template test lang foo.pbc
+ // rosella_dump_pbc foo.pbc --quiet --ns | xargs rosella_test_template test lang foo.pbc
var module = Rosella.Reflect.Module.load(libpath);
+ if (dump_header) {
+ // TODO: What other info can we put here?
+ Rosella.IO.sayf("%s", module);
+ }
+
if (dump_namespaces) {
say("Namespaces:");
if (dump_functions) {

0 comments on commit 0f6b180

Please sign in to comment.