+2006-12-23 Jürg Billeter <j@bitron.ch>
+
+ * vala/valaattribute.vala: add get_bool method for boolean values
+ * compiler/valacompiler.vala: print message when detecting option errors
+
2006-12-10 Jürg Billeter <j@bitron.ch>
* vapi/glib-2.0.vala: add message logging functions
opt_context.parse (out args, out err);
if (err != null) {
+ stdout.printf ("%s\n", err.message);
+ stdout.printf ("Run '%s --help' to see a full list of available command line options.\n", args[0]);
return 1;
}
return 0;
}
+
+ /**
+ * Returns the boolean value of the specified named argument.
+ *
+ * @param name argument name
+ * @return boolean value
+ */
+ public bool get_bool (string! name) {
+ // FIXME: use hash table
+ foreach (NamedArgument arg in args) {
+ if (arg.name == name) {
+ if (arg.argument is LiteralExpression) {
+ var lit = ((LiteralExpression) arg.argument).literal;
+ if (lit is BooleanLiteral) {
+ return ((BooleanLiteral) lit).value;
+ }
+ }
+ }
+ }
+
+ return false;
+ }
}