MCPcopy Create free account
hub / github.com/Windscribe/Desktop-App / parseConnect

Method parseConnect

src/windscribe-cli/cliarguments.cpp:51–99  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

49}
50
51void CliArguments::parseConnect(const QStringList &args)
52{
53 if (args.length() <= 2) {
54 cliCommand_ = CLI_COMMAND_CONNECT;
55 return;
56 }
57
58 int idx = 2;
59 QString arg = args[idx].toLower();
60 if (getOptions(arg) == "n") {
61 nonBlocking_ = true;
62 idx++;
63 }
64
65 if (args.length() <= idx) {
66 cliCommand_ = CLI_COMMAND_CONNECT;
67 return;
68 }
69 arg = args[idx++].toLower();
70 if (isProtocol(arg)) {
71 protocol_ = getProtocol(arg);
72 port_ = getPort(arg);
73 cliCommand_ = CLI_COMMAND_CONNECT;
74 return;
75 }
76
77 if (arg == "best") {
78 locationStr_ = "best";
79 cliCommand_ = CLI_COMMAND_CONNECT_BEST;
80 } else if (arg == "static") {
81 if (args.length() <= idx) {
82 cliCommand_ = CLI_COMMAND_HELP;
83 return;
84 }
85 locationStr_ = args[idx++];
86 cliCommand_ = CLI_COMMAND_CONNECT_STATIC;
87 } else {
88 locationStr_ = arg;
89 cliCommand_ = CLI_COMMAND_CONNECT_LOCATION;
90 }
91
92 if (args.length() > idx) {
93 arg = args[idx].toLower();
94 if (isProtocol(arg)) {
95 protocol_ = getProtocol(arg);
96 port_ = getPort(arg);
97 }
98 }
99}
100
101void CliArguments::parseDisconnect(const QStringList &args)
102{

Callers

nothing calls this directly

Calls 4

getOptionsFunction · 0.85
isProtocolFunction · 0.85
getProtocolFunction · 0.85
getPortFunction · 0.85

Tested by

no test coverage detected