-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.cpp
32 lines (25 loc) · 797 Bytes
/
main.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
// SPDX-FileCopyrightText: 2024 Nick Korotysh <nick.korotysh@gmail.com>
//
// SPDX-License-Identifier: MIT
#include "torrentinfoview.hpp"
#include <QApplication>
#include <QCommandLineParser>
int main(int argc, char* argv[])
{
QApplication app(argc, argv);
QApplication::setApplicationName("torrent_view");
QApplication::setApplicationVersion("1.0");
QCommandLineParser parser;
parser.setApplicationDescription("Torrent viewer");
parser.addHelpOption();
parser.addVersionOption();
parser.addPositionalArgument("file", "file to view");
parser.process(app);
TorrentInfoView wnd;
if (const auto args = parser.positionalArguments(); !args.empty()) {
lt::torrent_info ti(args.first().toStdString());
wnd.setTorrentInfo(ti);
}
wnd.show();
return app.exec();
}