Skip to content

Commit

Permalink
add version
Browse files Browse the repository at this point in the history
  • Loading branch information
nongeneric committed Sep 27, 2014
1 parent 0d2f985 commit 4f286b7
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 2 deletions.
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ add_executable(lsd2dsl
ZipWriter.cpp
DslWriter.h
DslWriter.cpp
version.h
)

if(NOT CMAKE_RELEASE)
Expand Down
7 changes: 6 additions & 1 deletion decoder.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#include "version.h"
#include "ZipWriter.h"

#include "DslWriter.h"
#include "dictlsd/lsd.h"
#include "dictlsd/tools.h"
Expand Down Expand Up @@ -78,6 +78,7 @@ int main(int argc, char* argv[]) {
"ignore dictionaries with target language != target-filter")
("codes", "print supported languages and their codes")
("out", po::value<std::string>(&outputPath)->required(), "output directory")
("version", "print version")
;
po::variables_map console_vm;
po::store(po::parse_command_line(argc, argv, console_desc), console_vm);
Expand All @@ -89,6 +90,10 @@ int main(int argc, char* argv[]) {
printLanguages(std::cout);
return 0;
}
if (console_vm.count("version")) {
std::cout << "lsd2dsl version " << g_version << std::endl;
return 0;
}
po::notify(console_vm);
} catch(std::exception& e) {
std::cout << "can't parse program options:\n";
Expand Down
3 changes: 2 additions & 1 deletion qtgui/MainWindow.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#include "MainWindow.h"
#include "../version.h"

#include "../DslWriter.h"
#include "../dictlsd/lsd.h"
Expand Down Expand Up @@ -313,7 +314,7 @@ MainWindow::MainWindow(QWidget *parent)
setMinimumWidth(1200);
setMinimumHeight(800);

setWindowTitle("lsd2dsl");
setWindowTitle(QString("lsd2dsl - %1").arg(g_version));

auto form = new QFormLayout(this);
auto totalLabel = new QLabel("0");
Expand Down
3 changes: 3 additions & 0 deletions version.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#pragma once

const char* const g_version = "0.2.1";

0 comments on commit 4f286b7

Please sign in to comment.