qBittorrent
cmdoptions.h
Go to the documentation of this file.
1 /*
2  * Bittorrent Client using Qt and libtorrent.
3  * Copyright (C) 2016 Eugene Shalygin <eugene.shalygin@gmail.com>
4  * Copyright (C) 2014 Vladimir Golovnev <glassez@yandex.ru>
5  * Copyright (C) 2006 Christophe Dumez <chris@qbittorrent.org>
6  *
7  * This program is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU General Public License
9  * as published by the Free Software Foundation; either version 2
10  * of the License, or (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program; if not, write to the Free Software
19  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
20  *
21  * In addition, as a special exception, the copyright holders give permission to
22  * link this program with the OpenSSL project's "OpenSSL" library (or with
23  * modified versions of it that use the same license as the "OpenSSL" library),
24  * and distribute the linked executables. You must obey the GNU General Public
25  * License in all respects for all of the code used other than "OpenSSL". If you
26  * modify file(s), you may extend this exception to your version of the file(s),
27  * but you are not obligated to do so. If you do not wish to do so, delete this
28  * exception statement from your version.
29  */
30 
31 #pragma once
32 
33 #include <optional>
34 
35 #include <QString>
36 #include <QStringList>
37 
38 #include "base/exceptions.h"
39 
40 class QProcessEnvironment;
41 
43 {
44  bool showHelp;
47  bool sequential;
49 #if !defined(Q_OS_WIN) || defined(DISABLE_GUI)
51 #endif
52 #ifndef DISABLE_GUI
53  bool noSplash;
54 #elif !defined(Q_OS_WIN)
55  bool shouldDaemonize;
56 #endif
57  int webUiPort;
58  std::optional<bool> addPaused;
59  std::optional<bool> skipDialog;
60  QStringList torrents;
61  QString profileDir;
63  QString savePath;
64  QString category;
66 
67  explicit QBtCommandLineParameters(const QProcessEnvironment &);
68  QStringList paramList() const;
69 };
70 
72 {
73 public:
74  using RuntimeError::RuntimeError;
75 };
76 
78 void displayUsage(const QString &prgName);
void displayUsage(const QString &prgName)
Definition: cmdoptions.cpp:582
QBtCommandLineParameters parseCommandLine(const QStringList &args)
Definition: cmdoptions.cpp:399
args
Definition: tstool.py:153
std::optional< bool > addPaused
Definition: cmdoptions.h:58
QStringList paramList() const
Definition: cmdoptions.cpp:363
QBtCommandLineParameters(const QProcessEnvironment &)
Definition: cmdoptions.cpp:339
std::optional< bool > skipDialog
Definition: cmdoptions.h:59