mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2025-12-18 14:38:04 -06:00
@@ -326,6 +326,7 @@ namespace
|
||||
constexpr const BoolOption NO_SPLASH_OPTION {"no-splash"};
|
||||
#endif
|
||||
constexpr const IntOption WEBUI_PORT_OPTION {"webui-port"};
|
||||
constexpr const IntOption TORRENTING_PORT_OPTION {"torrenting-port"};
|
||||
constexpr const StringOption PROFILE_OPTION {"profile"};
|
||||
constexpr const StringOption CONFIGURATION_OPTION {"configuration"};
|
||||
constexpr const BoolOption RELATIVE_FASTRESUME {"relative-fastresume"};
|
||||
@@ -353,6 +354,7 @@ QBtCommandLineParameters::QBtCommandLineParameters(const QProcessEnvironment &en
|
||||
, shouldDaemonize(DAEMON_OPTION.value(env))
|
||||
#endif
|
||||
, webUiPort(WEBUI_PORT_OPTION.value(env, -1))
|
||||
, torrentingPort(TORRENTING_PORT_OPTION.value(env, -1))
|
||||
, addPaused(PAUSED_OPTION.value(env))
|
||||
, skipDialog(SKIP_DIALOG_OPTION.value(env))
|
||||
, profileDir(PROFILE_OPTION.value(env))
|
||||
@@ -427,6 +429,15 @@ QBtCommandLineParameters parseCommandLine(const QStringList &args)
|
||||
throw CommandLineParameterError(QObject::tr("%1 must specify a valid port (1 to 65535).")
|
||||
.arg(u"--webui-port"_qs));
|
||||
}
|
||||
else if (arg == TORRENTING_PORT_OPTION)
|
||||
{
|
||||
result.torrentingPort = TORRENTING_PORT_OPTION.value(arg);
|
||||
if ((result.torrentingPort < 1) || (result.torrentingPort > 65535))
|
||||
{
|
||||
throw CommandLineParameterError(QObject::tr("%1 must specify a valid port (1 to 65535).")
|
||||
.arg(u"--torrenting-port"_qs));
|
||||
}
|
||||
}
|
||||
#ifndef DISABLE_GUI
|
||||
else if (arg == NO_SPLASH_OPTION)
|
||||
{
|
||||
@@ -537,6 +548,9 @@ QString makeUsage(const QString &prgName)
|
||||
+ WEBUI_PORT_OPTION.usage(QObject::tr("port"))
|
||||
+ wrapText(QObject::tr("Change the Web UI port"))
|
||||
+ u'\n'
|
||||
+ TORRENTING_PORT_OPTION.usage(QObject::tr("port"))
|
||||
+ wrapText(QObject::tr("Change the torrenting port"))
|
||||
+ u'\n'
|
||||
#ifndef DISABLE_GUI
|
||||
+ NO_SPLASH_OPTION.usage() + wrapText(QObject::tr("Disable splash screen")) + u'\n'
|
||||
#elif !defined(Q_OS_WIN)
|
||||
|
||||
Reference in New Issue
Block a user