Skip to content

Commit 602f187

Browse files
author
Thidas Senavirathna
committed
fixed
1 parent 7e5adb3 commit 602f187

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

src/main/java/com/mycmd/commands/TelnetCommand.java

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package com.mycmd.commands;
22

3+
import com.mycmd.Command;
34
import com.mycmd.ShellContext;
45

56
import java.io.*;
@@ -16,7 +17,7 @@
1617
public class TelnetCommand implements Command {
1718

1819
@Override
19-
public void execute(String[] args, ShellContext context) throws Exception {
20+
public void execute(String[] args, ShellContext context) throws IOException {
2021
if (args.length < 1) {
2122
System.out.println("Usage: telnet <host> [port]");
2223
return;
@@ -80,4 +81,14 @@ public void execute(String[] args, ShellContext context) throws Exception {
8081
System.out.println("Connection failed: " + e.getMessage());
8182
}
8283
}
84+
85+
@Override
86+
public String description() {
87+
return "Simple TCP client for interactive sessions.";
88+
}
89+
90+
@Override
91+
public String usage() {
92+
return "telnet <host> [port]";
93+
}
8394
}

0 commit comments

Comments
 (0)