You are viewing a plain text version of this content. The canonical link for it is here.
Posted to scm@geronimo.apache.org by jd...@apache.org on 2008/11/26 15:23:20 UTC
svn commit: r720861 - in /geronimo/gshell/trunk/gshell-commands:
gshell-ssh/src/main/java/org/apache/geronimo/gshell/commands/ssh/SshAction.java
pom.xml
Author: jdillon
Date: Wed Nov 26 06:23:19 2008
New Revision: 720861
URL: http://svn.apache.org/viewvc?rev=720861&view=rev
Log:
Drop URI syntax, favor something closer to openssh
Modified:
geronimo/gshell/trunk/gshell-commands/gshell-ssh/src/main/java/org/apache/geronimo/gshell/commands/ssh/SshAction.java
geronimo/gshell/trunk/gshell-commands/pom.xml
Modified: geronimo/gshell/trunk/gshell-commands/gshell-ssh/src/main/java/org/apache/geronimo/gshell/commands/ssh/SshAction.java
URL: http://svn.apache.org/viewvc/geronimo/gshell/trunk/gshell-commands/gshell-ssh/src/main/java/org/apache/geronimo/gshell/commands/ssh/SshAction.java?rev=720861&r1=720860&r2=720861&view=diff
==============================================================================
--- geronimo/gshell/trunk/gshell-commands/gshell-ssh/src/main/java/org/apache/geronimo/gshell/commands/ssh/SshAction.java (original)
+++ geronimo/gshell/trunk/gshell-commands/gshell-ssh/src/main/java/org/apache/geronimo/gshell/commands/ssh/SshAction.java Wed Nov 26 06:23:19 2008
@@ -34,8 +34,6 @@
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-import java.net.URI;
-
/**
* Connect to a SSH server.
*
@@ -46,14 +44,17 @@
{
private final Logger log = LoggerFactory.getLogger(getClass());
- @Option(name="-u", aliases={"--username"})
+ @Option(name="-l", aliases={"--username"})
private String username;
- @Option(name="-p", aliases={"--password"})
+ @Option(name="-P", aliases={"--password"})
private String password;
- @Argument(required=true, index=0)
- private URI remote;
+ @Argument(required=true)
+ private String hostname;
+
+ @Option(name="-p", aliases={"--port"})
+ private int port = 22;
private BeanContainer container;
@@ -100,7 +101,11 @@
IO io = context.getIo();
MessageSource messages = context.getCommand().getMessages();
- io.info(messages.format("info.connecting", remote.getHost(), remote.getPort()));
+ //
+ // TODO: Parse hostname for <username>@<hostname>
+ //
+
+ io.info(messages.format("info.connecting", hostname, port));
// If the username/password was not configured via cli, then prompt the user for the values
if (username == null || password == null) {
@@ -124,7 +129,7 @@
SshClient client = container.getBean(SshClient.class);
log.debug("Created client: {}", client);
- ClientSession session = client.connect(remote.getHost(), remote.getPort());
+ ClientSession session = client.connect(hostname, port);
io.info(messages.getMessage("info.connected"));
session.authPassword(username, password);
Modified: geronimo/gshell/trunk/gshell-commands/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/gshell/trunk/gshell-commands/pom.xml?rev=720861&r1=720860&r2=720861&view=diff
==============================================================================
--- geronimo/gshell/trunk/gshell-commands/pom.xml (original)
+++ geronimo/gshell/trunk/gshell-commands/pom.xml Wed Nov 26 06:23:19 2008
@@ -60,13 +60,12 @@
<module>gshell-builtins</module>
<module>gshell-admin</module>
<module>gshell-optional</module>
- <!--
<module>gshell-repository</module>
- -->
<module>gshell-bsf</module>
<module>gshell-vfs</module>
<module>gshell-log4j</module>
<module>gshell-ssh</module>
+ <module>gshell-geronimo</module>
</modules>
</project>
\ No newline at end of file