diff options
author | Andreas Baumann <mail@andreasbaumann.cc> | 2015-08-09 21:02:24 +0200 |
---|---|---|
committer | Andreas Baumann <mail@andreasbaumann.cc> | 2015-08-09 21:02:24 +0200 |
commit | 2d858bec48ca9d612c877c1176d8d8864f810a2a (patch) | |
tree | 619cadf6d92ea709e6a0f3fa7d71b9cabffe76fb | |
parent | 462d0e660691d7ea97bf6d21cca006921ffaf34b (diff) | |
download | cssh-2d858bec48ca9d612c877c1176d8d8864f810a2a.tar.gz cssh-2d858bec48ca9d612c877c1176d8d8864f810a2a.tar.bz2 |
made -p <port> and <host> parameters work (as with ssh)
-rw-r--r-- | src/cssh.c | 7 | ||||
-rw-r--r-- | src/cssh_options.ggo | 6 |
2 files changed, 13 insertions, 0 deletions
@@ -219,7 +219,14 @@ int main( int argc, char *argv[] ) exit( EXIT_FAILURE ); } + if( args_info.inputs_num > 1 ) { + host = args_info.inputs[0]; + } ssh_options_set( session, SSH_OPTIONS_HOST, host ); + + if( args_info.port_given ) { + port = args_info.port_arg; + } ssh_options_set( session, SSH_OPTIONS_PORT, &port ); if( args_info.verbose_given ) { diff --git a/src/cssh_options.ggo b/src/cssh_options.ggo index 5407481..e05e7e7 100644 --- a/src/cssh_options.ggo +++ b/src/cssh_options.ggo @@ -16,3 +16,9 @@ section "Main Options" "Login user (default: current user)" string typestr="login_name" optional + + option "port" p + "Port to use for SSH (default: 22)" + int typestr="port" + optional + |