01: /*
02: * This is free software, licensed under the Gnu Public License (GPL)
03: * get a copy from <http://www.gnu.org/licenses/gpl.html>
04: *
05: * author: Henner Zeller <H.Zeller@acm.org>
06: */
07: package henplus.commands;
08:
09: import henplus.HenPlus;
10: import henplus.SQLSession;
11: import henplus.AbstractCommand;
12:
13: /**
14: * document me.
15: */
16: public class ExitCommand extends AbstractCommand {
17: /**
18: * returns the command-strings this command can handle.
19: */
20: public String[] getCommandList() {
21: return new String[] { "exit", "quit" };
22: }
23:
24: public boolean requiresValidSession(String cmd) {
25: return false;
26: }
27:
28: /**
29: * execute the command given.
30: */
31: public int execute(SQLSession session, String cmd, String param) {
32: HenPlus.getInstance().terminate();
33: return SUCCESS;
34: }
35:
36: /**
37: * return a descriptive string.
38: */
39: public String getShortDescription() {
40: return "exits HenPlus";
41: }
42:
43: public String getSynopsis(String cmd) {
44: return cmd;
45: }
46: }
47:
48: /*
49: * Local variables:
50: * c-basic-offset: 4
51: * compile-command: "ant -emacs -find build.xml"
52: * End:
53: */
|