From: Jürg Billeter Date: Thu, 29 Nov 2012 12:59:35 +0000 (+0100) Subject: Add --api-version option X-Git-Tag: 0.19.0~62 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a4cdb46acc72a8f892be51add007cd58447ce590;p=thirdparty%2Fvala.git Add --api-version option --- diff --git a/compiler/valacompiler.vala b/compiler/valacompiler.vala index 9f26a1633..1f471edd2 100644 --- a/compiler/valacompiler.vala +++ b/compiler/valacompiler.vala @@ -27,6 +27,7 @@ class Vala.Compiler { static string basedir; static string directory; static bool version; + static bool api_version; [CCode (array_length = false, array_null_terminated = true)] static string[] sources; [CCode (array_length = false, array_null_terminated = true)] @@ -97,6 +98,7 @@ class Vala.Compiler { { "basedir", 'b', 0, OptionArg.FILENAME, ref basedir, "Base source directory", "DIRECTORY" }, { "directory", 'd', 0, OptionArg.FILENAME, ref directory, "Output directory", "DIRECTORY" }, { "version", 0, 0, OptionArg.NONE, ref version, "Display version number", null }, + { "api-version", 0, 0, OptionArg.NONE, ref api_version, "Display API version number", null }, { "ccode", 'C', 0, OptionArg.NONE, ref ccode_only, "Output C code", null }, { "header", 'H', 0, OptionArg.FILENAME, ref header_filename, "Output C header file", "FILE" }, { "use-header", 0, 0, OptionArg.NONE, ref use_header, "Use C header file", null }, @@ -528,6 +530,9 @@ class Vala.Compiler { if (version) { stdout.printf ("Vala %s\n", Config.BUILD_VERSION); return 0; + } else if (api_version) { + stdout.printf ("%s\n", Config.PACKAGE_SUFFIX.substring (1)); + return 0; } if (sources == null && fast_vapis == null) {