diff options
author | Vladimir Glazounov <vg@openoffice.org> | 2003-04-01 12:17:07 +0000 |
---|---|---|
committer | Vladimir Glazounov <vg@openoffice.org> | 2003-04-01 12:17:07 +0000 |
commit | cf9a8c3031d8e02156b78ef158b58b799f823ead (patch) | |
tree | 622d237bdc95176a19a91b9405ecfe4814b58b3a /testshl2 | |
parent | 38cf4d20d3329f475a2bdbd47c3ce6a2f805ec6c (diff) |
INTEGRATION: CWS qadev3 (1.4.16); FILE MERGED
2003/03/31 09:12:00 lla 1.4.16.1: #108453# better version number handling
Diffstat (limited to 'testshl2')
-rw-r--r-- | testshl2/source/versioner.cxx | 49 |
1 files changed, 46 insertions, 3 deletions
diff --git a/testshl2/source/versioner.cxx b/testshl2/source/versioner.cxx index 62ff17a88e6f..9d4a7be45c44 100644 --- a/testshl2/source/versioner.cxx +++ b/testshl2/source/versioner.cxx @@ -2,9 +2,9 @@ * * $RCSfile: versioner.cxx,v $ * - * $Revision: 1.4 $ + * $Revision: 1.5 $ * - * last change: $Author: lla $ $Date: 2003-01-28 10:13:33 $ + * last change: $Author: vg $ $Date: 2003-04-01 13:17:07 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -61,6 +61,7 @@ #include <stdio.h> #include <stdlib.h> +#include <string> #include "versionhelper.hxx" @@ -75,6 +76,13 @@ int _cdecl main( int argc, char* argv[] ) #endif { static char* optionSet[] = { + "-time, display time only", + "-date, display date only", + "-upd, display UPD only", + "-minor, display minor only", + "-build, display build only", + "-inpath, display inpath only", + "-verbose, be verbose", "-h:s, display help or help on option", "-help:s, see -h", NULL @@ -100,6 +108,41 @@ int _cdecl main( int argc, char* argv[] ) rtl::OUString suLibraryName = rtl::OStringToOUString(opt.getFirstParam(), RTL_TEXTENCODING_ASCII_US ); VersionHelper aHelper(suLibraryName, opt); - std::cout << aHelper << std::endl; + if (! aHelper.isOk() ) + { + fprintf(stderr, "error: No version info found.\n"); + exit(1); + } + + if (opt.hasOpt("-time")) + { + fprintf(stdout, "%s\n", aHelper.getTime().getStr()); + } + else if (opt.hasOpt("-date")) + { + fprintf(stdout, "%s\n", aHelper.getDate().getStr()); + } + else if (opt.hasOpt("-upd")) + { + fprintf(stdout, "%s\n", aHelper.getUpd().getStr()); + } + else if (opt.hasOpt("-minor")) + { + fprintf(stdout, "%s\n", aHelper.getMinor().getStr()); + } + else if (opt.hasOpt("-build")) + { + fprintf(stdout, "%s\n", aHelper.getBuild().getStr()); + } + else if (opt.hasOpt("-inpath")) + { + fprintf(stdout, "%s\n", aHelper.getInpath().getStr()); + } + else + { + // std::cout << aHelper << std::endl; + aHelper.printall(stdout); + } + return 0; } |