From b1bb3c6f53f1b3d63ff35a9c2da39e36ea24a0e8 Mon Sep 17 00:00:00 2001 From: Dustin Mitchell Date: Thu, 15 Aug 2013 09:40:56 -0400 Subject: [PATCH] Bug 884931 - signmar should output the gecko version in its usage and/or --version. r=bbondy --- modules/libmar/tool/mar.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/modules/libmar/tool/mar.c b/modules/libmar/tool/mar.c index 9d4d18f7197a..74739c0e916b 100644 --- a/modules/libmar/tool/mar.c +++ b/modules/libmar/tool/mar.c @@ -28,6 +28,11 @@ int mar_repackage_and_sign(const char *NSSConfigDir, const char *src, const char * dest); +static void print_version() { + printf("Version: %s\n", MOZ_APP_VERSION); + printf("Default Channel ID: %s\n", MAR_CHANNEL_ID); +} + static void print_usage() { printf("usage:\n"); printf("Create a MAR file:\n"); @@ -66,6 +71,8 @@ static void print_usage() { printf("Print information on a MAR file:\n"); printf(" mar [-H MARChannelID] [-V ProductVersion] [-C workingDir] " "-i unsigned_archive_to_refresh.mar\n"); + printf("Print executable version:\n"); + printf(" mar --version\n"); printf("This program does not handle unicode file paths properly\n"); } @@ -117,6 +124,11 @@ int main(int argc, char **argv) { memset(DERFilePaths, 0, sizeof(DERFilePaths)); #endif + if (argc > 1 && 0 == strcmp(argv[1], "--version")) { + print_version(); + return 0; + } + if (argc < 3) { print_usage(); return -1;