Skip to content

Commit

Permalink
format
Browse files Browse the repository at this point in the history
  • Loading branch information
MisterTea committed Apr 30, 2024
1 parent 414fba8 commit 47eb074
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 13 deletions.
7 changes: 4 additions & 3 deletions src/terminal/SshSetupHandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ string genCommand(const string& passkey, const string& id,

string SshSetupHandler::SetupSsh(const string& user, const string& host,
const string& host_alias, int port,
const string& jumphost, const string& jServerFifo, bool kill,
const string& jumphost,
const string& jServerFifo, bool kill,
int vlevel, const string& cmd_prefix,
const string& serverFifo,
const std::vector<std::string>& ssh_options) {
Expand Down Expand Up @@ -73,7 +74,7 @@ string SshSetupHandler::SetupSsh(const string& user, const string& host,
ssh_args.push_back(SSH_SCRIPT_DST);

std::string ssh_concat;
for (const auto &piece : ssh_args) ssh_concat += piece + " ";
for (const auto& piece : ssh_args) ssh_concat += piece + " ";
VLOG(1) << "Trying ssh with args: " << ssh_concat << endl;
auto sshBuffer = SubprocessToStringInteractive("ssh", ssh_args);

Expand Down Expand Up @@ -115,7 +116,7 @@ string SshSetupHandler::SetupSsh(const string& user, const string& host,
jump_cmdoptions += " --serverfifo=" + jServerFifo;
}
jump_cmdoptions = jump_cmdoptions + " --jump --dsthost=" + host +
" --dstport=" + to_string(port);
" --dstport=" + to_string(port);
string SSH_SCRIPT_JUMP = genCommand(passkey, id, clientTerm, user, kill,
cmd_prefix, jump_cmdoptions);

Expand Down
5 changes: 2 additions & 3 deletions src/terminal/SshSetupHandler.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,8 @@ class SshSetupHandler {
public:
static string SetupSsh(const string &user, const string &host,
const string &host_alias, int port,
const string &jumphost,
const string& jServerFifo, bool kill,
int vlevel, const string &etterminal_path,
const string &jumphost, const string &jServerFifo,
bool kill, int vlevel, const string &etterminal_path,
const string &serverFifo,
const std::vector<std::string> &ssh_options);
static const string ETTERMINAL_BIN;
Expand Down
9 changes: 5 additions & 4 deletions src/terminal/TerminalClientMain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,8 @@ int main(int argc, char** argv) {
cxxopts::value<std::string>()) //
("jport", "Jumphost machine port",
cxxopts::value<int>()->default_value("2022")) //
("jserverfifo", "If set, communicate to jumphost on the matching fifo name",
("jserverfifo",
"If set, communicate to jumphost on the matching fifo name",
cxxopts::value<string>()->default_value("")) //
("x,kill-other-sessions",
"kill all old sessions belonging to the user") //
Expand Down Expand Up @@ -317,9 +318,9 @@ int main(int argc, char** argv) {
etterminal_path = result["terminal-path"].as<string>();
}
string idpasskeypair = SshSetupHandler::SetupSsh(
username, destinationHost, host_alias, destinationPort, jumphost, jServerFifo,
result.count("x") > 0, result["verbose"].as<int>(), etterminal_path,
serverFifo, ssh_options);
username, destinationHost, host_alias, destinationPort, jumphost,
jServerFifo, result.count("x") > 0, result["verbose"].as<int>(),
etterminal_path, serverFifo, ssh_options);

string id = "", passkey = "";
// Trim whitespace
Expand Down
4 changes: 2 additions & 2 deletions test/ConnectionTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -140,8 +140,8 @@ class TestServerConnection : public ServerConnection {
public:
TestServerConnection(shared_ptr<SocketHandler> _socketHandler,
SocketEndpoint socketEndpoint)
: ServerConnection(_socketHandler, socketEndpoint){};
virtual ~TestServerConnection(){};
: ServerConnection(_socketHandler, socketEndpoint) {};
virtual ~TestServerConnection() {};
virtual bool newClient(
shared_ptr<ServerClientConnection> _serverClientState) {
string clientId = _serverClientState->getId();
Expand Down
2 changes: 1 addition & 1 deletion test/FakeConsole.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ class FakeUserTerminal : public UserTerminal {
return getFd();
};

virtual void runTerminal(){
virtual void runTerminal() {

};

Expand Down

0 comments on commit 47eb074

Please sign in to comment.