comparison src/main.cpp @ 643:0e0844310914

Add --version or -v option
author Chris Cannam
date Mon, 07 Jan 2013 10:53:48 +0000
parents 533519ebc0cb
children ae67ea0af696
comparison
equal deleted inserted replaced
642:b16e8ef6919b 643:0e0844310914
16 */ 16 */
17 17
18 #include "mainwindow.h" 18 #include "mainwindow.h"
19 #include "common.h" 19 #include "common.h"
20 #include "debug.h" 20 #include "debug.h"
21 #include "version.h"
21 22
22 #include <QApplication> 23 #include <QApplication>
23 #include <QTranslator> 24 #include <QTranslator>
24 #include <QDir> 25 #include <QDir>
25 26
27 using std::cout;
28 using std::endl;
29
26 int main(int argc, char *argv[]) 30 int main(int argc, char *argv[])
27 { 31 {
32 if (argc == 2 &&
33 (!strcmp(argv[1], "-v") ||
34 !strcmp(argv[1], "--version"))) {
35 cout << "EasyMercurial v" << EASYHG_VERSION << "\n"
36 << "Copyright (c) 2010 Jari Korhonen\n"
37 << "Copyright (c) 2012 Chris Cannam\n"
38 << "Copyright (c) 2012 Queen Mary, University of London\n"
39 << "This program is free software; you can redistribute it and/or\n"
40 << "modify it under the terms of the GNU General Public License as\n"
41 << "published by the Free Software Foundation; either version 2 of the\n"
42 << "License, or (at your option) any later version. See the file\n"
43 << "COPYING included with this distribution for more information."
44 << endl;
45 return 0;
46 }
47
28 QApplication app(argc, argv); 48 QApplication app(argc, argv);
29 49
30 QApplication::setOrganizationName("easymercurial"); 50 QApplication::setOrganizationName("easymercurial");
31 QApplication::setOrganizationDomain("easymercurial.org"); 51 QApplication::setOrganizationDomain("easymercurial.org");
32 QApplication::setApplicationName(QApplication::tr("EasyMercurial")); 52 QApplication::setApplicationName(QApplication::tr("EasyMercurial"));