From 869cdb1090c5ea3e16a5b2f11276ffcabd09a982 Mon Sep 17 00:00:00 2001 From: Jekyll Wu Date: Sun, 21 Aug 2011 09:17:42 +0800 Subject: [PATCH] support `-p port` in ssh command for specifying non-default port. --- src/ProcessInfo.cpp | 7 +++++++ src/ProcessInfo.h | 6 ++++++ 2 files changed, 13 insertions(+) diff --git a/src/ProcessInfo.cpp b/src/ProcessInfo.cpp index ad743a333..5f8c86a79 100644 --- a/src/ProcessInfo.cpp +++ b/src/ProcessInfo.cpp @@ -1032,6 +1032,9 @@ SSHProcessInfo::SSHProcessInfo(const ProcessInfo& process) // support using `-l user` to specify username. if ( argChar == 'l' ) _user = args[i+1] ; + // support using `-p port` to specify port. + else if ( argChar == 'p' ) + _port = args[i+1] ; i++; continue; @@ -1083,6 +1086,10 @@ QString SSHProcessInfo::host() const { return _host; } +QString SSHProcessInfo::port() const +{ + return _port; +} QString SSHProcessInfo::command() const { return _command; diff --git a/src/ProcessInfo.h b/src/ProcessInfo.h index 0d18f4095..64729f97d 100644 --- a/src/ProcessInfo.h +++ b/src/ProcessInfo.h @@ -432,6 +432,11 @@ public: */ QString host() const; + /** + * Returns the port on host which the user has connected to. + */ + QString port() const; + /** * Returns the command which the user specified to execute on the * remote computer when starting the SSH process. @@ -457,6 +462,7 @@ private: const ProcessInfo& _process; QString _user; QString _host; + QString _port; QString _command; };