MCPcopy Create free account
hub / github.com/PCSX2/pcsx2 / ParseCommandLineOptions

Method ParseCommandLineOptions

pcsx2-qt/QtHost.cpp:2180–2379  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2178}
2179
2180bool QtHost::ParseCommandLineOptions(const QStringList& args, std::shared_ptr<VMBootParameters>& autoboot)
2181{
2182 bool no_more_args = false;
2183
2184 if (args.empty())
2185 {
2186 // Nothing to do here.
2187 return true;
2188 }
2189
2190 for (auto it = std::next(args.begin()); it != args.end(); ++it)
2191 {
2192 if (!no_more_args)
2193 {
2194#define CHECK_ARG(str) (*it == str)
2195#define CHECK_ARG_PARAM(str) (*it == str && std::next(it) != args.end())
2196
2197 if (CHECK_ARG(QStringLiteral("-help")))
2198 {
2199 PrintCommandLineHelp(args.front().toStdString());
2200 return false;
2201 }
2202 else if (CHECK_ARG(QStringLiteral("-version")))
2203 {
2204 PrintCommandLineVersion();
2205 return false;
2206 }
2207 else if (CHECK_ARG(QStringLiteral("-batch")))
2208 {
2209 s_batch_mode = true;
2210 continue;
2211 }
2212 else if (CHECK_ARG(QStringLiteral("-nogui")))
2213 {
2214 s_batch_mode = true;
2215 s_nogui_mode = true;
2216 continue;
2217 }
2218 else if (CHECK_ARG(QStringLiteral("-portable")))
2219 {
2220 EmuConfig.IsPortableMode = true;
2221 continue;
2222 }
2223 else if (CHECK_ARG_PARAM(QStringLiteral("-datapath")))
2224 {
2225 std::string path = (++it)->toStdString();
2226 EmuConfig.CustomDataPath = path;
2227 continue;
2228 }
2229 else if (CHECK_ARG(QStringLiteral("-fastboot")))
2230 {
2231 AutoBoot(autoboot)->fast_boot = true;
2232 continue;
2233 }
2234 else if (CHECK_ARG(QStringLiteral("-slowboot")))
2235 {
2236 AutoBoot(autoboot)->fast_boot = false;
2237 continue;

Callers

nothing calls this directly

Calls 10

nextFunction · 0.85
PrintCommandLineHelpFunction · 0.85
PrintCommandLineVersionFunction · 0.85
argMethod · 0.80
emptyMethod · 0.45
beginMethod · 0.45
endMethod · 0.45
frontMethod · 0.45
WarningMethod · 0.45
resetMethod · 0.45

Tested by

no test coverage detected