瀏覽代碼

Add BasicCommandInfo and make core commands use it

Change-Id: I24e8daf8cc076d90328f7c38cf539420566bf14e
Fixes-Issue: CLIENT-262
Reviewed-on: http://gerrit.dmdirc.com/2009
Reviewed-by: Greg Holmes <greg@dmdirc.com>
Automatic-Compile: DMDirc Build Manager
tags/0.6.6b1
Chris Smith 13 年之前
父節點
當前提交
7cd4171bf1
共有 59 個文件被更改,包括 518 次插入1273 次删除
  1. 78
    0
      src/com/dmdirc/commandparser/BaseCommandInfo.java
  2. 2
    0
      src/com/dmdirc/commandparser/CommandInfo.java
  3. 45
    45
      src/com/dmdirc/commandparser/CommandManager.java
  4. 7
    25
      src/com/dmdirc/commandparser/commands/channel/Ban.java
  5. 7
    25
      src/com/dmdirc/commandparser/commands/channel/ChannelSettings.java
  6. 7
    24
      src/com/dmdirc/commandparser/commands/channel/Cycle.java
  7. 7
    25
      src/com/dmdirc/commandparser/commands/channel/Invite.java
  8. 7
    26
      src/com/dmdirc/commandparser/commands/channel/KickReason.java
  9. 7
    25
      src/com/dmdirc/commandparser/commands/channel/Mode.java
  10. 7
    25
      src/com/dmdirc/commandparser/commands/channel/Names.java
  11. 7
    24
      src/com/dmdirc/commandparser/commands/channel/Part.java
  12. 8
    27
      src/com/dmdirc/commandparser/commands/channel/SetNickColour.java
  13. 7
    26
      src/com/dmdirc/commandparser/commands/channel/ShowTopic.java
  14. 7
    25
      src/com/dmdirc/commandparser/commands/chat/Me.java
  15. 7
    26
      src/com/dmdirc/commandparser/commands/global/AliasCommand.java
  16. 7
    27
      src/com/dmdirc/commandparser/commands/global/AllServers.java
  17. 7
    26
      src/com/dmdirc/commandparser/commands/global/Clear.java
  18. 8
    27
      src/com/dmdirc/commandparser/commands/global/Echo.java
  19. 7
    25
      src/com/dmdirc/commandparser/commands/global/Exit.java
  20. 7
    25
      src/com/dmdirc/commandparser/commands/global/Help.java
  21. 8
    27
      src/com/dmdirc/commandparser/commands/global/Ifplugin.java
  22. 8
    26
      src/com/dmdirc/commandparser/commands/global/Input.java
  23. 7
    26
      src/com/dmdirc/commandparser/commands/global/LoadPlugin.java
  24. 7
    26
      src/com/dmdirc/commandparser/commands/global/NewServer.java
  25. 7
    26
      src/com/dmdirc/commandparser/commands/global/Notify.java
  26. 8
    26
      src/com/dmdirc/commandparser/commands/global/OpenWindow.java
  27. 7
    26
      src/com/dmdirc/commandparser/commands/global/ReloadActions.java
  28. 7
    26
      src/com/dmdirc/commandparser/commands/global/ReloadIdentities.java
  29. 7
    26
      src/com/dmdirc/commandparser/commands/global/ReloadPlugin.java
  30. 7
    26
      src/com/dmdirc/commandparser/commands/global/SaveConfig.java
  31. 9
    27
      src/com/dmdirc/commandparser/commands/global/Set.java
  32. 7
    26
      src/com/dmdirc/commandparser/commands/global/UnloadPlugin.java
  33. 7
    27
      src/com/dmdirc/commandparser/commands/server/AllChannels.java
  34. 6
    25
      src/com/dmdirc/commandparser/commands/server/Away.java
  35. 6
    25
      src/com/dmdirc/commandparser/commands/server/Back.java
  36. 7
    25
      src/com/dmdirc/commandparser/commands/server/ChangeServer.java
  37. 7
    26
      src/com/dmdirc/commandparser/commands/server/Ctcp.java
  38. 7
    25
      src/com/dmdirc/commandparser/commands/server/Disconnect.java
  39. 7
    26
      src/com/dmdirc/commandparser/commands/server/Ignore.java
  40. 7
    25
      src/com/dmdirc/commandparser/commands/server/JoinChannelCommand.java
  41. 7
    25
      src/com/dmdirc/commandparser/commands/server/Message.java
  42. 7
    26
      src/com/dmdirc/commandparser/commands/server/Nick.java
  43. 7
    26
      src/com/dmdirc/commandparser/commands/server/Notice.java
  44. 7
    25
      src/com/dmdirc/commandparser/commands/server/OpenQuery.java
  45. 7
    25
      src/com/dmdirc/commandparser/commands/server/Raw.java
  46. 7
    26
      src/com/dmdirc/commandparser/commands/server/Reconnect.java
  47. 7
    26
      src/com/dmdirc/commandparser/commands/server/ServerSettings.java
  48. 7
    25
      src/com/dmdirc/commandparser/commands/server/Umode.java
  49. 3
    3
      test/com/dmdirc/commandparser/commands/channel/BanTest.java
  50. 6
    6
      test/com/dmdirc/commandparser/commands/channel/KickReasonTest.java
  51. 5
    5
      test/com/dmdirc/commandparser/commands/channel/ModeTest.java
  52. 2
    2
      test/com/dmdirc/commandparser/commands/channel/NamesTest.java
  53. 4
    4
      test/com/dmdirc/commandparser/commands/channel/PartTest.java
  54. 11
    11
      test/com/dmdirc/commandparser/commands/channel/SetNickColourTest.java
  55. 5
    5
      test/com/dmdirc/commandparser/commands/chat/MeTest.java
  56. 8
    8
      test/com/dmdirc/commandparser/commands/global/AliasCommandTest.java
  57. 2
    2
      test/com/dmdirc/commandparser/commands/global/IfpluginTest.java
  58. 11
    11
      test/com/dmdirc/commandparser/commands/global/NewServerTest.java
  59. 16
    16
      test/com/dmdirc/commandparser/commands/server/ChangeServerTest.java

+ 78
- 0
src/com/dmdirc/commandparser/BaseCommandInfo.java 查看文件

@@ -0,0 +1,78 @@
1
+/*
2
+ * Copyright (c) 2006-2011 Chris Smith, Shane Mc Cormack, Gregory Holmes
3
+ *
4
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
5
+ * of this software and associated documentation files (the "Software"), to deal
6
+ * in the Software without restriction, including without limitation the rights
7
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8
+ * copies of the Software, and to permit persons to whom the Software is
9
+ * furnished to do so, subject to the following conditions:
10
+ *
11
+ * The above copyright notice and this permission notice shall be included in
12
+ * all copies or substantial portions of the Software.
13
+ *
14
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20
+ * SOFTWARE.
21
+ */
22
+
23
+package com.dmdirc.commandparser;
24
+
25
+/**
26
+ * A basic {@link CommandInfo} implementation whose parameters can be
27
+ * configured via the constructor.
28
+ */
29
+public class BaseCommandInfo implements CommandInfo {
30
+
31
+    /** The name of the command. */
32
+    private final String name;
33
+
34
+    /** The help text for this command. */
35
+    private final String helpText;
36
+
37
+    /** The type of the command. */
38
+    private final CommandType type;
39
+
40
+    /**
41
+     * Creates a new BaseCommandInfo with the specified information.
42
+     *
43
+     * @param name The name of the command
44
+     * @param helpText The help text for this command
45
+     * @param type The type of the command
46
+     */
47
+    public BaseCommandInfo(final String name, final String helpText,
48
+            final CommandType type) {
49
+        this.name = name;
50
+        this.helpText = helpText;
51
+        this.type = type;
52
+    }
53
+
54
+    /** {@inheritDoc} */
55
+    @Override
56
+    public String getName() {
57
+        return name;
58
+    }
59
+
60
+    /** {@inheritDoc} */
61
+    @Override
62
+    public boolean showInHelp() {
63
+        return true;
64
+    }
65
+
66
+    /** {@inheritDoc} */
67
+    @Override
68
+    public String getHelp() {
69
+        return helpText;
70
+    }
71
+
72
+    /** {@inheritDoc} */
73
+    @Override
74
+    public CommandType getType() {
75
+        return type;
76
+    }
77
+
78
+}

+ 2
- 0
src/com/dmdirc/commandparser/CommandInfo.java 查看文件

@@ -38,7 +38,9 @@ public interface CommandInfo {
38 38
      * Returns whether or not this command should be shown in help messages.
39 39
      *
40 40
      * @return True iff the command should be shown, false otherwise
41
+     * @deprecated All commands should be shown in help messages
41 42
      */
43
+    @Deprecated
42 44
     boolean showInHelp();
43 45
 
44 46
     /**

+ 45
- 45
src/com/dmdirc/commandparser/CommandManager.java 查看文件

@@ -225,37 +225,37 @@ public class CommandManager {
225 225
      */
226 226
     public void initCommands() {
227 227
         // Chat commands
228
-        registerCommand(new Me());
228
+        registerCommand(new Me(), Me.INFO);
229 229
 
230 230
         // Channel commands
231
-        registerCommand(new Ban());
232
-        registerCommand(new ChannelSettings());
233
-        registerCommand(new Cycle());
234
-        registerCommand(new Invite());
235
-        registerCommand(new KickReason());
236
-        registerCommand(new Mode());
237
-        registerCommand(new Names());
238
-        registerCommand(new Part());
239
-        registerCommand(new SetNickColour());
240
-        registerCommand(new ShowTopic());
231
+        registerCommand(new Ban(), Ban.INFO);
232
+        registerCommand(new ChannelSettings(), ChannelSettings.INFO);
233
+        registerCommand(new Cycle(), Cycle.INFO);
234
+        registerCommand(new Invite(), Invite.INFO);
235
+        registerCommand(new KickReason(), KickReason.INFO);
236
+        registerCommand(new Mode(), Mode.INFO);
237
+        registerCommand(new Names(), Names.INFO);
238
+        registerCommand(new Part(), Part.INFO);
239
+        registerCommand(new SetNickColour(), SetNickColour.INFO);
240
+        registerCommand(new ShowTopic(), ShowTopic.INFO);
241 241
 
242 242
         // Server commands
243
-        registerCommand(new AllChannels());
244
-        registerCommand(new Away());
245
-        registerCommand(new Back());
246
-        registerCommand(new ChangeServer());
247
-        registerCommand(new Ctcp());
248
-        registerCommand(new Disconnect());
249
-        registerCommand(new Ignore());
250
-        registerCommand(new JoinChannelCommand());
251
-        registerCommand(new Message());
252
-        registerCommand(new Nick());
253
-        registerCommand(new Notice());
254
-        registerCommand(new OpenQuery());
255
-        registerCommand(new Raw());
256
-        registerCommand(new Reconnect());
257
-        registerCommand(new ServerSettings());
258
-        registerCommand(new Umode());
243
+        registerCommand(new AllChannels(), AllChannels.INFO);
244
+        registerCommand(new Away(), Away.INFO);
245
+        registerCommand(new Back(), Back.INFO);
246
+        registerCommand(new ChangeServer(), ChangeServer.INFO);
247
+        registerCommand(new Ctcp(), Ctcp.INFO);
248
+        registerCommand(new Disconnect(), Disconnect.INFO);
249
+        registerCommand(new Ignore(), Ignore.INFO);
250
+        registerCommand(new JoinChannelCommand(), JoinChannelCommand.INFO);
251
+        registerCommand(new Message(), Message.INFO);
252
+        registerCommand(new Nick(), Nick.INFO);
253
+        registerCommand(new Notice(), Notice.INFO);
254
+        registerCommand(new OpenQuery(), OpenQuery.INFO);
255
+        registerCommand(new Raw(), Raw.INFO);
256
+        registerCommand(new Reconnect(), Reconnect.INFO);
257
+        registerCommand(new ServerSettings(), ServerSettings.INFO);
258
+        registerCommand(new Umode(), Umode.INFO);
259 259
 
260 260
         registerCommand(new RawServerCommand("lusers"));
261 261
         registerCommand(new RawServerCommand("map"));
@@ -267,24 +267,24 @@ public class CommandManager {
267 267
         // Query commands
268 268
 
269 269
         // Global commands
270
-        registerCommand(new AliasCommand());
271
-        registerCommand(new AllServers());
272
-        registerCommand(new Clear());
273
-        registerCommand(new Echo());
274
-        registerCommand(new Exit());
275
-        registerCommand(new Help());
276
-        registerCommand(new Ifplugin());
277
-        registerCommand(new Input());
278
-        registerCommand(new NewServer());
279
-        registerCommand(new Notify());
280
-        registerCommand(new LoadPlugin());
281
-        registerCommand(new UnloadPlugin());
282
-        registerCommand(new OpenWindow());
283
-        registerCommand(new ReloadActions());
284
-        registerCommand(new ReloadIdentities());
285
-        registerCommand(new ReloadPlugin());
286
-        registerCommand(new SaveConfig());
287
-        registerCommand(new Set());
270
+        registerCommand(new AliasCommand(), AliasCommand.INFO);
271
+        registerCommand(new AllServers(), AllServers.INFO);
272
+        registerCommand(new Clear(), Clear.INFO);
273
+        registerCommand(new Echo(), Echo.INFO);
274
+        registerCommand(new Exit(), Exit.INFO);
275
+        registerCommand(new Help(), Help.INFO);
276
+        registerCommand(new Ifplugin(), Ifplugin.INFO);
277
+        registerCommand(new Input(), Input.INFO);
278
+        registerCommand(new NewServer(), NewServer.INFO);
279
+        registerCommand(new Notify(), Notify.INFO);
280
+        registerCommand(new LoadPlugin(), LoadPlugin.INFO);
281
+        registerCommand(new UnloadPlugin(), UnloadPlugin.INFO);
282
+        registerCommand(new OpenWindow(), OpenWindow.INFO);
283
+        registerCommand(new ReloadActions(), ReloadActions.INFO);
284
+        registerCommand(new ReloadIdentities(), ReloadIdentities.INFO);
285
+        registerCommand(new ReloadPlugin(), ReloadPlugin.INFO);
286
+        registerCommand(new SaveConfig(), SaveConfig.INFO);
287
+        registerCommand(new Set(), Set.INFO);
288 288
 
289 289
         // Set up a listener for config changes
290 290
         final ConfigChangeListener listener = new ConfigChangeListener() {

+ 7
- 25
src/com/dmdirc/commandparser/commands/channel/Ban.java 查看文件

@@ -24,6 +24,7 @@ package com.dmdirc.commandparser.commands.channel;
24 24
 
25 25
 import com.dmdirc.Channel;
26 26
 import com.dmdirc.FrameContainer;
27
+import com.dmdirc.commandparser.BaseCommandInfo;
27 28
 import com.dmdirc.commandparser.CommandArguments;
28 29
 import com.dmdirc.commandparser.CommandInfo;
29 30
 import com.dmdirc.commandparser.CommandType;
@@ -38,7 +39,12 @@ import com.dmdirc.ui.input.TabCompletionType;
38 39
 /**
39 40
  * The kick command bans a specified user or host from the channel.
40 41
  */
41
-public class Ban extends Command implements IntelligentCommand, CommandInfo {
42
+public class Ban extends Command implements IntelligentCommand {
43
+
44
+    /** A command info object for this command. */
45
+    public static final CommandInfo INFO = new BaseCommandInfo("ban",
46
+            "ban <user|host> - bans the specified user or host from the channel",
47
+            CommandType.TYPE_CHANNEL);
42 48
 
43 49
     /** {@inheritDoc} */
44 50
     @Override
@@ -62,30 +68,6 @@ public class Ban extends Command implements IntelligentCommand, CommandInfo {
62 68
         channel.getChannelInfo().flushModes();
63 69
     }
64 70
 
65
-    /** {@inheritDoc} */
66
-    @Override
67
-    public String getName() {
68
-        return "ban";
69
-    }
70
-
71
-    /** {@inheritDoc} */
72
-    @Override
73
-    public boolean showInHelp() {
74
-        return true;
75
-    }
76
-
77
-    /** {@inheritDoc} */
78
-    @Override
79
-    public CommandType getType() {
80
-        return CommandType.TYPE_CHANNEL;
81
-    }
82
-
83
-    /** {@inheritDoc} */
84
-    @Override
85
-    public String getHelp() {
86
-        return "ban <user|host> - bans the specified user or host from the channel.";
87
-    }
88
-
89 71
     /** {@inheritDoc} */
90 72
     @Override
91 73
     public AdditionalTabTargets getSuggestions(final int arg,

+ 7
- 25
src/com/dmdirc/commandparser/commands/channel/ChannelSettings.java 查看文件

@@ -23,6 +23,7 @@
23 23
 package com.dmdirc.commandparser.commands.channel;
24 24
 
25 25
 import com.dmdirc.FrameContainer;
26
+import com.dmdirc.commandparser.BaseCommandInfo;
26 27
 import com.dmdirc.commandparser.CommandArguments;
27 28
 import com.dmdirc.commandparser.CommandInfo;
28 29
 import com.dmdirc.commandparser.CommandType;
@@ -38,7 +39,12 @@ import com.dmdirc.ui.input.AdditionalTabTargets;
38 39
  */
39 40
 @CommandOptions(allowOffline = false)
40 41
 public class ChannelSettings extends Command implements
41
-        IntelligentCommand, CommandInfo {
42
+        IntelligentCommand {
43
+
44
+    /** A command info object for this command. */
45
+    public static final CommandInfo INFO = new BaseCommandInfo("channelsettings",
46
+            "channelsettings - opens the channel settings window",
47
+            CommandType.TYPE_CHANNEL);
42 48
 
43 49
     /** {@inheritDoc} */
44 50
     @Override
@@ -48,30 +54,6 @@ public class ChannelSettings extends Command implements
48 54
                 ((ChannelCommandContext) context).getChannel());
49 55
     }
50 56
 
51
-    /** {@inheritDoc} */
52
-    @Override
53
-    public String getName() {
54
-        return "channelsettings";
55
-    }
56
-
57
-    /** {@inheritDoc} */
58
-    @Override
59
-    public boolean showInHelp() {
60
-        return true;
61
-    }
62
-
63
-    /** {@inheritDoc} */
64
-    @Override
65
-    public CommandType getType() {
66
-        return CommandType.TYPE_CHANNEL;
67
-    }
68
-
69
-    /** {@inheritDoc} */
70
-    @Override
71
-    public String getHelp() {
72
-        return "channelsettings - opens the channel settings window";
73
-    }
74
-
75 57
     /** {@inheritDoc} */
76 58
     @Override
77 59
     public AdditionalTabTargets getSuggestions(final int arg,

+ 7
- 24
src/com/dmdirc/commandparser/commands/channel/Cycle.java 查看文件

@@ -24,6 +24,7 @@ package com.dmdirc.commandparser.commands.channel;
24 24
 
25 25
 import com.dmdirc.Channel;
26 26
 import com.dmdirc.FrameContainer;
27
+import com.dmdirc.commandparser.BaseCommandInfo;
27 28
 import com.dmdirc.commandparser.CommandArguments;
28 29
 import com.dmdirc.commandparser.CommandInfo;
29 30
 import com.dmdirc.commandparser.CommandType;
@@ -36,7 +37,12 @@ import com.dmdirc.commandparser.commands.context.CommandContext;
36 37
  * The cycle command allows users to rapidly part and rejoin a channel.
37 38
  */
38 39
 @CommandOptions(allowOffline = false)
39
-public class Cycle extends Command implements CommandInfo {
40
+public class Cycle extends Command {
41
+
42
+    /** A command info object for this command. */
43
+    public static final CommandInfo INFO = new BaseCommandInfo("cycle",
44
+            "cycle [message] - parts and rejoins the channel",
45
+            CommandType.TYPE_CHANNEL);
40 46
 
41 47
     /** {@inheritDoc} */
42 48
     @Override
@@ -48,27 +54,4 @@ public class Cycle extends Command implements CommandInfo {
48 54
         channel.join();
49 55
     }
50 56
 
51
-    /** {@inheritDoc} */
52
-    @Override
53
-    public String getName() {
54
-        return "cycle";
55
-    }
56
-
57
-    /** {@inheritDoc} */
58
-    @Override
59
-    public boolean showInHelp() {
60
-        return true;
61
-    }
62
-
63
-    /** {@inheritDoc} */
64
-    @Override
65
-    public CommandType getType() {
66
-        return CommandType.TYPE_CHANNEL;
67
-    }
68
-
69
-    /** {@inheritDoc} */
70
-    @Override
71
-    public String getHelp() {
72
-        return "cycle [message] - parts and rejoins the channel";
73
-    }
74 57
 }

+ 7
- 25
src/com/dmdirc/commandparser/commands/channel/Invite.java 查看文件

@@ -25,6 +25,7 @@ package com.dmdirc.commandparser.commands.channel;
25 25
 import com.dmdirc.Channel;
26 26
 import com.dmdirc.FrameContainer;
27 27
 import com.dmdirc.Server;
28
+import com.dmdirc.commandparser.BaseCommandInfo;
28 29
 import com.dmdirc.commandparser.CommandArguments;
29 30
 import com.dmdirc.commandparser.CommandInfo;
30 31
 import com.dmdirc.commandparser.CommandType;
@@ -41,7 +42,12 @@ import com.dmdirc.parser.interfaces.ChannelInfo;
41 42
  * @since 0.6.4
42 43
  */
43 44
 @CommandOptions(allowOffline = false)
44
-public class Invite extends Command implements ExternalCommand, CommandInfo {
45
+public class Invite extends Command implements ExternalCommand {
46
+
47
+    /** A command info object for this command. */
48
+    public static final CommandInfo INFO = new BaseCommandInfo("invite",
49
+            "invite <user> - invites user to a channel",
50
+            CommandType.TYPE_CHANNEL);
45 51
 
46 52
     /** {@inheritDoc} */
47 53
     @Override
@@ -70,28 +76,4 @@ public class Invite extends Command implements ExternalCommand, CommandInfo {
70 76
         }
71 77
     }
72 78
 
73
-    /** {@inheritDoc} */
74
-    @Override
75
-    public String getName() {
76
-        return "invite";
77
-    }
78
-
79
-    /** {@inheritDoc} */
80
-    @Override
81
-    public boolean showInHelp() {
82
-        return true;
83
-    }
84
-
85
-    /** {@inheritDoc} */
86
-    @Override
87
-    public CommandType getType() {
88
-        return CommandType.TYPE_CHANNEL;
89
-    }
90
-
91
-    /** {@inheritDoc} */
92
-    @Override
93
-    public String getHelp() {
94
-        return "invite <user> - invites user to a channel";
95
-    }
96
-
97 79
 }

+ 7
- 26
src/com/dmdirc/commandparser/commands/channel/KickReason.java 查看文件

@@ -24,6 +24,7 @@ package com.dmdirc.commandparser.commands.channel;
24 24
 
25 25
 import com.dmdirc.Channel;
26 26
 import com.dmdirc.FrameContainer;
27
+import com.dmdirc.commandparser.BaseCommandInfo;
27 28
 import com.dmdirc.commandparser.CommandArguments;
28 29
 import com.dmdirc.commandparser.CommandInfo;
29 30
 import com.dmdirc.commandparser.CommandType;
@@ -41,8 +42,12 @@ import com.dmdirc.ui.input.TabCompletionType;
41 42
  * This version allows the user to specify a reason.
42 43
  */
43 44
 @CommandOptions(allowOffline = false)
44
-public class KickReason extends Command implements IntelligentCommand,
45
-        CommandInfo {
45
+public class KickReason extends Command implements IntelligentCommand {
46
+
47
+    /** A command info object for this command. */
48
+    public static final CommandInfo INFO = new BaseCommandInfo("kick",
49
+            "kick <user> [reason] - kicks the specified user from the channel",
50
+            CommandType.TYPE_CHANNEL);
46 51
 
47 52
     /** {@inheritDoc} */
48 53
     @Override
@@ -66,30 +71,6 @@ public class KickReason extends Command implements IntelligentCommand,
66 71
         }
67 72
     }
68 73
 
69
-    /** {@inheritDoc} */
70
-    @Override
71
-    public String getName() {
72
-        return "kick";
73
-    }
74
-
75
-    /** {@inheritDoc} */
76
-    @Override
77
-    public boolean showInHelp() {
78
-        return true;
79
-    }
80
-
81
-    /** {@inheritDoc} */
82
-    @Override
83
-    public CommandType getType() {
84
-        return CommandType.TYPE_CHANNEL;
85
-    }
86
-
87
-    /** {@inheritDoc} */
88
-    @Override
89
-    public String getHelp() {
90
-        return "kick <user> [reason] - kicks the specified user from the channel";
91
-    }
92
-
93 74
     /** {@inheritDoc} */
94 75
     @Override
95 76
     public AdditionalTabTargets getSuggestions(final int arg,

+ 7
- 25
src/com/dmdirc/commandparser/commands/channel/Mode.java 查看文件

@@ -25,6 +25,7 @@ package com.dmdirc.commandparser.commands.channel;
25 25
 import com.dmdirc.Channel;
26 26
 import com.dmdirc.FrameContainer;
27 27
 import com.dmdirc.Server;
28
+import com.dmdirc.commandparser.BaseCommandInfo;
28 29
 import com.dmdirc.commandparser.CommandArguments;
29 30
 import com.dmdirc.commandparser.CommandInfo;
30 31
 import com.dmdirc.commandparser.CommandType;
@@ -43,7 +44,12 @@ import com.dmdirc.ui.input.TabCompletionType;
43 44
  */
44 45
 @CommandOptions(allowOffline = false)
45 46
 public class Mode extends Command implements IntelligentCommand,
46
-        ExternalCommand, CommandInfo {
47
+        ExternalCommand {
48
+
49
+    /** A command info object for this command. */
50
+    public static final CommandInfo INFO = new BaseCommandInfo("mode",
51
+            "mode [changes] - displays or changes the current channel modes",
52
+            CommandType.TYPE_CHANNEL);
47 53
 
48 54
     /** {@inheritDoc} */
49 55
     @Override
@@ -71,30 +77,6 @@ public class Mode extends Command implements IntelligentCommand,
71 77
         }
72 78
     }
73 79
 
74
-    /** {@inheritDoc} */
75
-    @Override
76
-    public String getName() {
77
-        return "mode";
78
-    }
79
-
80
-    /** {@inheritDoc} */
81
-    @Override
82
-    public boolean showInHelp() {
83
-        return true;
84
-    }
85
-
86
-    /** {@inheritDoc} */
87
-    @Override
88
-    public CommandType getType() {
89
-        return CommandType.TYPE_CHANNEL;
90
-    }
91
-
92
-    /** {@inheritDoc} */
93
-    @Override
94
-    public String getHelp() {
95
-        return "mode [changes] - displays or changes the current channel modes";
96
-    }
97
-
98 80
     /** {@inheritDoc} */
99 81
     @Override
100 82
     public AdditionalTabTargets getSuggestions(final int arg,

+ 7
- 25
src/com/dmdirc/commandparser/commands/channel/Names.java 查看文件

@@ -25,6 +25,7 @@ package com.dmdirc.commandparser.commands.channel;
25 25
 import com.dmdirc.Channel;
26 26
 import com.dmdirc.FrameContainer;
27 27
 import com.dmdirc.Server;
28
+import com.dmdirc.commandparser.BaseCommandInfo;
28 29
 import com.dmdirc.commandparser.CommandArguments;
29 30
 import com.dmdirc.commandparser.CommandInfo;
30 31
 import com.dmdirc.commandparser.CommandType;
@@ -41,7 +42,12 @@ import com.dmdirc.ui.input.AdditionalTabTargets;
41 42
  */
42 43
 @CommandOptions(allowOffline = false)
43 44
 public class Names extends Command implements IntelligentCommand,
44
-        ExternalCommand, CommandInfo {
45
+        ExternalCommand {
46
+
47
+    /** A command info object for this command. */
48
+    public static final CommandInfo INFO = new BaseCommandInfo("names",
49
+            "names - Requests a list of users that are in the channel",
50
+            CommandType.TYPE_CHANNEL);
45 51
 
46 52
     /** {@inheritDoc} */
47 53
     @Override
@@ -59,30 +65,6 @@ public class Names extends Command implements IntelligentCommand,
59 65
         server.getParser().sendRawMessage("NAMES " + channel);
60 66
     }
61 67
 
62
-    /** {@inheritDoc} */
63
-    @Override
64
-    public String getName() {
65
-        return "names";
66
-    }
67
-
68
-    /** {@inheritDoc} */
69
-    @Override
70
-    public boolean showInHelp() {
71
-        return true;
72
-    }
73
-
74
-    /** {@inheritDoc} */
75
-    @Override
76
-    public CommandType getType() {
77
-        return CommandType.TYPE_CHANNEL;
78
-    }
79
-
80
-    /** {@inheritDoc} */
81
-    @Override
82
-    public String getHelp() {
83
-        return "names - Requests a list of users that are in the channel";
84
-    }
85
-
86 68
     /** {@inheritDoc} */
87 69
     @Override
88 70
     public AdditionalTabTargets getSuggestions(final int arg,

+ 7
- 24
src/com/dmdirc/commandparser/commands/channel/Part.java 查看文件

@@ -24,6 +24,7 @@ package com.dmdirc.commandparser.commands.channel;
24 24
 
25 25
 import com.dmdirc.Channel;
26 26
 import com.dmdirc.FrameContainer;
27
+import com.dmdirc.commandparser.BaseCommandInfo;
27 28
 import com.dmdirc.commandparser.CommandArguments;
28 29
 import com.dmdirc.commandparser.CommandInfo;
29 30
 import com.dmdirc.commandparser.CommandType;
@@ -36,7 +37,12 @@ import com.dmdirc.commandparser.commands.context.CommandContext;
36 37
  * The part command parts the current channel with a specified part message.
37 38
  */
38 39
 @CommandOptions(allowOffline=false)
39
-public class Part extends Command implements CommandInfo {
40
+public class Part extends Command {
41
+
42
+    /** A command info object for this command. */
43
+    public static final CommandInfo INFO = new BaseCommandInfo("part",
44
+            "part [reason] - parts the channel",
45
+            CommandType.TYPE_CHANNEL);
40 46
 
41 47
     /** {@inheritDoc} */
42 48
     @Override
@@ -48,27 +54,4 @@ public class Part extends Command implements CommandInfo {
48 54
         channel.close();
49 55
     }
50 56
 
51
-    /** {@inheritDoc} */
52
-    @Override
53
-    public String getName() {
54
-        return "part";
55
-    }
56
-
57
-    /** {@inheritDoc} */
58
-    @Override
59
-    public boolean showInHelp() {
60
-        return true;
61
-    }
62
-
63
-    /** {@inheritDoc} */
64
-    @Override
65
-    public CommandType getType() {
66
-        return CommandType.TYPE_CHANNEL;
67
-    }
68
-
69
-    /** {@inheritDoc} */
70
-    @Override
71
-    public String getHelp() {
72
-        return "part [reason] - parts the channel";
73
-    }
74 57
 }

+ 8
- 27
src/com/dmdirc/commandparser/commands/channel/SetNickColour.java 查看文件

@@ -25,6 +25,7 @@ package com.dmdirc.commandparser.commands.channel;
25 25
 import com.dmdirc.Channel;
26 26
 import com.dmdirc.ChannelClientProperty;
27 27
 import com.dmdirc.FrameContainer;
28
+import com.dmdirc.commandparser.BaseCommandInfo;
28 29
 import com.dmdirc.commandparser.CommandArguments;
29 30
 import com.dmdirc.commandparser.CommandInfo;
30 31
 import com.dmdirc.commandparser.CommandType;
@@ -42,8 +43,13 @@ import java.awt.Color;
42 43
 /**
43 44
  * Allows the user to set a nickname on the channel to use a custom colour.
44 45
  */
45
-public class SetNickColour extends Command implements IntelligentCommand,
46
-        CommandInfo {
46
+public class SetNickColour extends Command implements IntelligentCommand {
47
+
48
+    /** A command info object for this command. */
49
+    public static final CommandInfo INFO = new BaseCommandInfo("setnickcolour",
50
+            "setnickcolour [--nicklist|--text] <nick> [colour] - "
51
+            + "set the specified person's display colour",
52
+            CommandType.TYPE_CHANNEL);
47 53
 
48 54
     /** {@inheritDoc} */
49 55
     @Override
@@ -107,31 +113,6 @@ public class SetNickColour extends Command implements IntelligentCommand,
107 113
         }
108 114
     }
109 115
 
110
-    /** {@inheritDoc} */
111
-    @Override
112
-    public String getName() {
113
-        return "setnickcolour";
114
-    }
115
-
116
-    /** {@inheritDoc} */
117
-    @Override
118
-    public boolean showInHelp() {
119
-        return true;
120
-    }
121
-
122
-    /** {@inheritDoc} */
123
-    @Override
124
-    public CommandType getType() {
125
-        return CommandType.TYPE_CHANNEL;
126
-    }
127
-
128
-    /** {@inheritDoc} */
129
-    @Override
130
-    public String getHelp() {
131
-        return "setnickcolour [--nicklist|--text] <nick> [colour] - "
132
-                + "set the specified person's display colour";
133
-    }
134
-
135 116
     /** {@inheritDoc} */
136 117
     @Override
137 118
     public AdditionalTabTargets getSuggestions(final int arg,

+ 7
- 26
src/com/dmdirc/commandparser/commands/channel/ShowTopic.java 查看文件

@@ -25,6 +25,7 @@ package com.dmdirc.commandparser.commands.channel;
25 25
 import com.dmdirc.Channel;
26 26
 import com.dmdirc.FrameContainer;
27 27
 import com.dmdirc.Server;
28
+import com.dmdirc.commandparser.BaseCommandInfo;
28 29
 import com.dmdirc.commandparser.CommandArguments;
29 30
 import com.dmdirc.commandparser.CommandInfo;
30 31
 import com.dmdirc.commandparser.CommandType;
@@ -39,8 +40,12 @@ import com.dmdirc.parser.interfaces.ChannelInfo;
39 40
  * The show topic command shows the user the current topic.
40 41
  */
41 42
 @CommandOptions(allowOffline=false)
42
-public class ShowTopic extends Command implements ExternalCommand,
43
-        CommandInfo {
43
+public class ShowTopic extends Command implements ExternalCommand {
44
+
45
+    /** A command info object for this command. */
46
+    public static final CommandInfo INFO = new BaseCommandInfo("topic",
47
+            "topic - displays the current topic\ntopic <newtopic> - sets the channel topic",
48
+            CommandType.TYPE_CHANNEL);
44 49
 
45 50
     /** {@inheritDoc} */
46 51
     @Override
@@ -75,28 +80,4 @@ public class ShowTopic extends Command implements ExternalCommand,
75 80
         }
76 81
     }
77 82
 
78
-    /** {@inheritDoc} */
79
-    @Override
80
-    public String getName() {
81
-        return "topic";
82
-    }
83
-
84
-    /** {@inheritDoc} */
85
-    @Override
86
-    public boolean showInHelp() {
87
-        return true;
88
-    }
89
-
90
-    /** {@inheritDoc} */
91
-    @Override
92
-    public CommandType getType() {
93
-        return CommandType.TYPE_CHANNEL;
94
-    }
95
-
96
-    /** {@inheritDoc} */
97
-    @Override
98
-    public String getHelp() {
99
-        return "topic - displays the current topic\ntopic <newtopic> - sets the channel topic";
100
-    }
101
-
102 83
 }

+ 7
- 25
src/com/dmdirc/commandparser/commands/chat/Me.java 查看文件

@@ -24,6 +24,7 @@ package com.dmdirc.commandparser.commands.chat;
24 24
 
25 25
 import com.dmdirc.FrameContainer;
26 26
 import com.dmdirc.MessageTarget;
27
+import com.dmdirc.commandparser.BaseCommandInfo;
27 28
 import com.dmdirc.commandparser.CommandArguments;
28 29
 import com.dmdirc.commandparser.CommandInfo;
29 30
 import com.dmdirc.commandparser.CommandType;
@@ -37,7 +38,12 @@ import com.dmdirc.util.validators.ValidationResponse;
37 38
 /**
38 39
  * The me command sends a CTCP action to the current channel.
39 40
  */
40
-public class Me extends Command implements ValidatingCommand, CommandInfo {
41
+public class Me extends Command implements ValidatingCommand {
42
+
43
+    /** A command info object for this command. */
44
+    public static final CommandInfo INFO = new BaseCommandInfo("me",
45
+            "me <action> - sends the specified action",
46
+            CommandType.TYPE_CHAT);
41 47
 
42 48
     /** {@inheritDoc} */
43 49
     @Override
@@ -51,30 +57,6 @@ public class Me extends Command implements ValidatingCommand, CommandInfo {
51 57
         }
52 58
     }
53 59
 
54
-    /** {@inheritDoc} */
55
-    @Override
56
-    public String getName() {
57
-        return "me";
58
-    }
59
-
60
-    /** {@inheritDoc} */
61
-    @Override
62
-    public boolean showInHelp() {
63
-        return true;
64
-    }
65
-
66
-    /** {@inheritDoc} */
67
-    @Override
68
-    public CommandType getType() {
69
-        return CommandType.TYPE_CHAT;
70
-    }
71
-
72
-    /** {@inheritDoc} */
73
-    @Override
74
-    public String getHelp() {
75
-        return "me <action> - sends the specified action";
76
-    }
77
-
78 60
     /** {@inheritDoc} */
79 61
     @Override
80 62
     public ValidationResponse validateArguments(final InputWindow origin,

+ 7
- 26
src/com/dmdirc/commandparser/commands/global/AliasCommand.java 查看文件

@@ -27,6 +27,7 @@ import com.dmdirc.actions.Action;
27 27
 import com.dmdirc.actions.ActionManager;
28 28
 import com.dmdirc.actions.wrappers.Alias;
29 29
 import com.dmdirc.actions.wrappers.AliasWrapper;
30
+import com.dmdirc.commandparser.BaseCommandInfo;
30 31
 import com.dmdirc.commandparser.CommandArguments;
31 32
 import com.dmdirc.commandparser.CommandInfo;
32 33
 import com.dmdirc.commandparser.CommandManager;
@@ -40,8 +41,12 @@ import com.dmdirc.ui.input.TabCompleter;
40 41
 /**
41 42
  * The alias command allows users to create aliases on-the-fly.
42 43
  */
43
-public class AliasCommand extends Command implements
44
-        IntelligentCommand, CommandInfo {
44
+public class AliasCommand extends Command implements IntelligentCommand {
45
+
46
+    /** A command info object for this command. */
47
+    public static final CommandInfo INFO = new BaseCommandInfo("alias",
48
+            "alias [--remove] <name> [command] - creates or removes the specified alias",
49
+            CommandType.TYPE_GLOBAL);
45 50
 
46 51
     /** {@inheritDoc} */
47 52
     @Override
@@ -110,30 +115,6 @@ public class AliasCommand extends Command implements
110 115
         return false;
111 116
     }
112 117
 
113
-    /** {@inheritDoc} */
114
-    @Override
115
-    public String getName() {
116
-        return "alias";
117
-    }
118
-
119
-    /** {@inheritDoc} */
120
-    @Override
121
-    public boolean showInHelp() {
122
-        return true;
123
-    }
124
-
125
-    /** {@inheritDoc} */
126
-    @Override
127
-    public CommandType getType() {
128
-        return CommandType.TYPE_GLOBAL;
129
-    }
130
-
131
-    /** {@inheritDoc} */
132
-    @Override
133
-    public String getHelp() {
134
-        return "alias [--remove] <name> [command] - creates or removes the specified alias";
135
-    }
136
-
137 118
     /** {@inheritDoc} */
138 119
     @Override
139 120
     public AdditionalTabTargets getSuggestions(final int arg,

+ 7
- 27
src/com/dmdirc/commandparser/commands/global/AllServers.java 查看文件

@@ -25,6 +25,7 @@ package com.dmdirc.commandparser.commands.global;
25 25
 import com.dmdirc.FrameContainer;
26 26
 import com.dmdirc.Server;
27 27
 import com.dmdirc.ServerManager;
28
+import com.dmdirc.commandparser.BaseCommandInfo;
28 29
 import com.dmdirc.commandparser.CommandArguments;
29 30
 import com.dmdirc.commandparser.CommandInfo;
30 31
 import com.dmdirc.commandparser.CommandType;
@@ -37,8 +38,12 @@ import com.dmdirc.ui.input.TabCompleter;
37 38
 /**
38 39
  * The AllServers command allows users to issue commands to all servers.
39 40
  */
40
-public class AllServers extends Command implements IntelligentCommand,
41
-        CommandInfo{
41
+public class AllServers extends Command implements IntelligentCommand {
42
+
43
+    /** A command info object for this command. */
44
+    public static final CommandInfo INFO = new BaseCommandInfo("allservers",
45
+            "allservers <command> - executes the command as though it had"
46
+            + " been entered on all servers", CommandType.TYPE_GLOBAL);
42 47
 
43 48
     /** {@inheritDoc} */
44 49
     @Override
@@ -51,31 +56,6 @@ public class AllServers extends Command implements IntelligentCommand,
51 56
         }
52 57
     }
53 58
 
54
-    /** {@inheritDoc} */
55
-    @Override
56
-    public String getName() {
57
-        return "allservers";
58
-    }
59
-
60
-    /** {@inheritDoc} */
61
-    @Override
62
-    public boolean showInHelp() {
63
-        return true;
64
-    }
65
-
66
-    /** {@inheritDoc} */
67
-    @Override
68
-    public CommandType getType() {
69
-        return CommandType.TYPE_GLOBAL;
70
-    }
71
-
72
-    /** {@inheritDoc} */
73
-    @Override
74
-    public String getHelp() {
75
-        return "allservers <command> - executes the command as though it had"
76
-                + " been entered on all servers";
77
-    }
78
-
79 59
     /** {@inheritDoc} */
80 60
     @Override
81 61
     public AdditionalTabTargets getSuggestions(final int arg,

+ 7
- 26
src/com/dmdirc/commandparser/commands/global/Clear.java 查看文件

@@ -23,6 +23,7 @@
23 23
 package com.dmdirc.commandparser.commands.global;
24 24
 
25 25
 import com.dmdirc.FrameContainer;
26
+import com.dmdirc.commandparser.BaseCommandInfo;
26 27
 import com.dmdirc.commandparser.CommandArguments;
27 28
 import com.dmdirc.commandparser.CommandInfo;
28 29
 import com.dmdirc.commandparser.CommandType;
@@ -34,8 +35,12 @@ import com.dmdirc.ui.input.AdditionalTabTargets;
34 35
 /**
35 36
  * The clear command clears the main text area of the current window.
36 37
  */
37
-public class Clear extends Command implements IntelligentCommand,
38
-        CommandInfo {
38
+public class Clear extends Command implements IntelligentCommand {
39
+
40
+    /** A command info object for this command. */
41
+    public static final CommandInfo INFO = new BaseCommandInfo("clear",
42
+            "clear - clears the current window's text area",
43
+            CommandType.TYPE_GLOBAL);
39 44
 
40 45
     /** {@inheritDoc} */
41 46
     @Override
@@ -44,30 +49,6 @@ public class Clear extends Command implements IntelligentCommand,
44 49
         origin.getDocument().clear();
45 50
     }
46 51
 
47
-    /** {@inheritDoc} */
48
-    @Override
49
-    public String getName() {
50
-        return "clear";
51
-    }
52
-
53
-    /** {@inheritDoc} */
54
-    @Override
55
-    public boolean showInHelp() {
56
-        return true;
57
-    }
58
-
59
-    /** {@inheritDoc} */
60
-    @Override
61
-    public CommandType getType() {
62
-        return CommandType.TYPE_GLOBAL;
63
-    }
64
-
65
-    /** {@inheritDoc} */
66
-    @Override
67
-    public String getHelp() {
68
-        return "clear - clears the current window's text area";
69
-    }
70
-
71 52
     /** {@inheritDoc} */
72 53
     @Override
73 54
     public AdditionalTabTargets getSuggestions(final int arg,

+ 8
- 27
src/com/dmdirc/commandparser/commands/global/Echo.java 查看文件

@@ -25,6 +25,7 @@ package com.dmdirc.commandparser.commands.global;
25 25
 import com.dmdirc.CustomWindow;
26 26
 import com.dmdirc.FrameContainer;
27 27
 import com.dmdirc.Server;
28
+import com.dmdirc.commandparser.BaseCommandInfo;
28 29
 import com.dmdirc.commandparser.CommandArguments;
29 30
 import com.dmdirc.commandparser.CommandInfo;
30 31
 import com.dmdirc.commandparser.CommandType;
@@ -44,8 +45,13 @@ import java.util.List;
44 45
 /**
45 46
  * The echo commands simply echos text to the current window.
46 47
  */
47
-public class Echo extends Command implements IntelligentCommand,
48
-        CommandInfo {
48
+public class Echo extends Command implements IntelligentCommand {
49
+
50
+    /** A command info object for this command. */
51
+    public static final CommandInfo INFO = new BaseCommandInfo("echo",
52
+            "echo [--ts <timestamp>] [--target <window>] <line> "
53
+            + "- echos the specified line to the window",
54
+            CommandType.TYPE_GLOBAL);
49 55
 
50 56
     /** The flag used to specify a timestamp for the echo command. */
51 57
     private final CommandFlag timeStampFlag = new CommandFlag("ts", true, 1, 0);
@@ -108,31 +114,6 @@ public class Echo extends Command implements IntelligentCommand,
108 114
         }
109 115
     }
110 116
 
111
-    /** {@inheritDoc} */
112
-    @Override
113
-    public String getName() {
114
-        return "echo";
115
-    }
116
-
117
-    /** {@inheritDoc} */
118
-    @Override
119
-    public boolean showInHelp() {
120
-        return true;
121
-    }
122
-
123
-    /** {@inheritDoc} */
124
-    @Override
125
-    public CommandType getType() {
126
-        return CommandType.TYPE_GLOBAL;
127
-    }
128
-
129
-    /** {@inheritDoc} */
130
-    @Override
131
-    public String getHelp() {
132
-        return "echo [--ts <timestamp>] [--target <window>] <line> "
133
-                + "- echos the specified line to the window";
134
-    }
135
-
136 117
     /** {@inheritDoc} */
137 118
     @Override
138 119
     public AdditionalTabTargets getSuggestions(final int arg,

+ 7
- 25
src/com/dmdirc/commandparser/commands/global/Exit.java 查看文件

@@ -24,6 +24,7 @@ package com.dmdirc.commandparser.commands.global;
24 24
 
25 25
 import com.dmdirc.FrameContainer;
26 26
 import com.dmdirc.Main;
27
+import com.dmdirc.commandparser.BaseCommandInfo;
27 28
 import com.dmdirc.commandparser.CommandArguments;
28 29
 import com.dmdirc.commandparser.CommandInfo;
29 30
 import com.dmdirc.commandparser.CommandType;
@@ -35,7 +36,12 @@ import com.dmdirc.commandparser.commands.context.CommandContext;
35 36
  * When the client quits, it disconnects all servers (with the quit message
36 37
  * supplied) and saves the config file.
37 38
  */
38
-public class Exit extends Command implements CommandInfo {
39
+public class Exit extends Command {
40
+
41
+    /** A command info object for this command. */
42
+    public static final CommandInfo INFO = new BaseCommandInfo("exit",
43
+            "exit [reason] - exits the client",
44
+            CommandType.TYPE_GLOBAL);
39 45
 
40 46
     /** {@inheritDoc} */
41 47
     @Override
@@ -45,28 +51,4 @@ public class Exit extends Command implements CommandInfo {
45 51
                 : origin.getConfigManager().getOption("general", "closemessage"));
46 52
     }
47 53
 
48
-    /** {@inheritDoc}. */
49
-    @Override
50
-    public String getName() {
51
-        return "exit";
52
-    }
53
-
54
-    /** {@inheritDoc}. */
55
-    @Override
56
-    public boolean showInHelp() {
57
-        return true;
58
-    }
59
-
60
-    /** {@inheritDoc} */
61
-    @Override
62
-    public CommandType getType() {
63
-        return CommandType.TYPE_GLOBAL;
64
-    }
65
-
66
-    /** {@inheritDoc}. */
67
-    @Override
68
-    public String getHelp() {
69
-        return "exit [reason] - exits the client";
70
-    }
71
-
72 54
 }

+ 7
- 25
src/com/dmdirc/commandparser/commands/global/Help.java 查看文件

@@ -24,6 +24,7 @@ package com.dmdirc.commandparser.commands.global;
24 24
 
25 25
 import com.dmdirc.FrameContainer;
26 26
 import com.dmdirc.WritableFrameContainer;
27
+import com.dmdirc.commandparser.BaseCommandInfo;
27 28
 import com.dmdirc.commandparser.CommandArguments;
28 29
 import com.dmdirc.commandparser.CommandInfo;
29 30
 import com.dmdirc.commandparser.CommandManager;
@@ -45,7 +46,12 @@ import java.util.Map;
45 46
  * their arguments, and a description. It is context-aware, so channel commands
46 47
  * are only displayed when in a channel window, for example.
47 48
  */
48
-public class Help extends Command implements IntelligentCommand, CommandInfo {
49
+public class Help extends Command implements IntelligentCommand {
50
+
51
+    /** A command info object for this command. */
52
+    public static final CommandInfo INFO = new BaseCommandInfo("help",
53
+            "help [command] - shows client command help",
54
+            CommandType.TYPE_GLOBAL);
49 55
 
50 56
     /** {@inheritDoc} */
51 57
     @Override
@@ -128,30 +134,6 @@ public class Help extends Command implements IntelligentCommand, CommandInfo {
128 134
         }
129 135
     }
130 136
 
131
-    /** {@inheritDoc}. */
132
-    @Override
133
-    public String getName() {
134
-        return "help";
135
-    }
136
-
137
-    /** {@inheritDoc}. */
138
-    @Override
139
-    public boolean showInHelp() {
140
-        return true;
141
-    }
142
-
143
-    /** {@inheritDoc} */
144
-    @Override
145
-    public CommandType getType() {
146
-        return CommandType.TYPE_GLOBAL;
147
-    }
148
-
149
-    /** {@inheritDoc}. */
150
-    @Override
151
-    public String getHelp() {
152
-        return "help [command] - shows client command help";
153
-    }
154
-
155 137
     /** {@inheritDoc} */
156 138
     @Override
157 139
     public AdditionalTabTargets getSuggestions(final int arg,

+ 8
- 27
src/com/dmdirc/commandparser/commands/global/Ifplugin.java 查看文件

@@ -24,6 +24,7 @@ package com.dmdirc.commandparser.commands.global;
24 24
 
25 25
 import com.dmdirc.FrameContainer;
26 26
 import com.dmdirc.WritableFrameContainer;
27
+import com.dmdirc.commandparser.BaseCommandInfo;
27 28
 import com.dmdirc.commandparser.CommandArguments;
28 29
 import com.dmdirc.commandparser.CommandInfo;
29 30
 import com.dmdirc.commandparser.CommandType;
@@ -40,8 +41,13 @@ import com.dmdirc.ui.input.TabCompleter;
40 41
  * The if plugin command allows the user to execute commands based on whether
41 42
  * or not a plugin is loaded.
42 43
  */
43
-public class Ifplugin extends Command implements IntelligentCommand,
44
-        CommandInfo {
44
+public class Ifplugin extends Command implements IntelligentCommand {
45
+
46
+    /** A command info object for this command. */
47
+    public static final CommandInfo INFO = new BaseCommandInfo("ifplugin",
48
+            "ifplugin <[!]plugin> <command> - executes a command if the "
49
+            + "specified plugin is/isn't loaded",
50
+            CommandType.TYPE_GLOBAL);
45 51
 
46 52
     /** {@inheritDoc} */
47 53
     @Override
@@ -75,31 +81,6 @@ public class Ifplugin extends Command implements IntelligentCommand,
75 81
         }
76 82
     }
77 83
 
78
-    /** {@inheritDoc} */
79
-    @Override
80
-    public String getName() {
81
-        return "ifplugin";
82
-    }
83
-
84
-    /** {@inheritDoc} */
85
-    @Override
86
-    public boolean showInHelp() {
87
-        return true;
88
-    }
89
-
90
-    /** {@inheritDoc} */
91
-    @Override
92
-    public CommandType getType() {
93
-        return CommandType.TYPE_GLOBAL;
94
-    }
95
-
96
-    /** {@inheritDoc} */
97
-    @Override
98
-    public String getHelp() {
99
-        return "ifplugin <[!]plugin> <command> - executes a command if the "
100
-                + "specified plugin is/isn't loaded";
101
-    }
102
-
103 84
     /** {@inheritDoc} */
104 85
     @Override
105 86
     public AdditionalTabTargets getSuggestions(final int arg,

+ 8
- 26
src/com/dmdirc/commandparser/commands/global/Input.java 查看文件

@@ -24,6 +24,7 @@
24 24
 package com.dmdirc.commandparser.commands.global;
25 25
 
26 26
 import com.dmdirc.FrameContainer;
27
+import com.dmdirc.commandparser.BaseCommandInfo;
27 28
 import com.dmdirc.commandparser.CommandArguments;
28 29
 import com.dmdirc.commandparser.CommandInfo;
29 30
 import com.dmdirc.commandparser.CommandType;
@@ -38,7 +39,13 @@ import com.dmdirc.ui.interfaces.InputWindow;
38 39
  *
39 40
  * @since 0.6.4
40 41
  */
41
-public class Input extends Command implements IntelligentCommand, CommandInfo {
42
+public class Input extends Command implements IntelligentCommand {
43
+
44
+    /** A command info object for this command. */
45
+    public static final CommandInfo INFO = new BaseCommandInfo("input",
46
+            "input [--clear] <text to insert into inputfield> - Adds text to"
47
+            + " the active window's input field",
48
+            CommandType.TYPE_GLOBAL);
42 49
 
43 50
     /** {@inheritDoc} */
44 51
     @Override
@@ -58,31 +65,6 @@ public class Input extends Command implements IntelligentCommand, CommandInfo {
58 65
         }
59 66
     }
60 67
 
61
-    /** {@inheritDoc} */
62
-    @Override
63
-    public String getName() {
64
-        return "input";
65
-    }
66
-
67
-    /** {@inheritDoc} */
68
-    @Override
69
-    public boolean showInHelp() {
70
-        return true;
71
-    }
72
-
73
-    /** {@inheritDoc} */
74
-    @Override
75
-    public CommandType getType() {
76
-        return CommandType.TYPE_GLOBAL;
77
-    }
78
-
79
-    /** {@inheritDoc} */
80
-    @Override
81
-    public String getHelp() {
82
-        return "input [--clear] <text to insert into inputfield> - Adds text to"
83
-                + " the active window's input field";
84
-    }
85
-
86 68
     /** {@inheritDoc} */
87 69
     @Override
88 70
     public AdditionalTabTargets getSuggestions(final int arg,

+ 7
- 26
src/com/dmdirc/commandparser/commands/global/LoadPlugin.java 查看文件

@@ -23,6 +23,7 @@
23 23
 package com.dmdirc.commandparser.commands.global;
24 24
 
25 25
 import com.dmdirc.FrameContainer;
26
+import com.dmdirc.commandparser.BaseCommandInfo;
26 27
 import com.dmdirc.commandparser.CommandArguments;
27 28
 import com.dmdirc.commandparser.CommandInfo;
28 29
 import com.dmdirc.commandparser.CommandType;
@@ -36,8 +37,12 @@ import com.dmdirc.ui.input.AdditionalTabTargets;
36 37
 /**
37 38
  * Allows the user to load a plugin.
38 39
  */
39
-public class LoadPlugin extends Command implements IntelligentCommand,
40
-        CommandInfo {
40
+public class LoadPlugin extends Command implements IntelligentCommand {
41
+
42
+    /** A command info object for this command. */
43
+    public static final CommandInfo INFO = new BaseCommandInfo("loadplugin",
44
+            "loadplugin <plugin> - loads the specified class as a plugin",
45
+            CommandType.TYPE_GLOBAL);
41 46
 
42 47
     /** {@inheritDoc} */
43 48
     @Override
@@ -74,30 +79,6 @@ public class LoadPlugin extends Command implements IntelligentCommand,
74 79
         }
75 80
     }
76 81
 
77
-    /** {@inheritDoc} */
78
-    @Override
79
-    public String getName() {
80
-        return "loadplugin";
81
-    }
82
-
83
-    /** {@inheritDoc} */
84
-    @Override
85
-    public boolean showInHelp() {
86
-        return true;
87
-    }
88
-
89
-    /** {@inheritDoc} */
90
-    @Override
91
-    public CommandType getType() {
92
-        return CommandType.TYPE_GLOBAL;
93
-    }
94
-
95
-    /** {@inheritDoc} */
96
-    @Override
97
-    public String getHelp() {
98
-        return "loadplugin <plugin> - loads the specified class as a plugin";
99
-    }
100
-
101 82
     /** {@inheritDoc} */
102 83
     @Override
103 84
     public AdditionalTabTargets getSuggestions(final int arg,

+ 7
- 26
src/com/dmdirc/commandparser/commands/global/NewServer.java 查看文件

@@ -24,6 +24,7 @@ package com.dmdirc.commandparser.commands.global;
24 24
 
25 25
 import com.dmdirc.FrameContainer;
26 26
 import com.dmdirc.Server;
27
+import com.dmdirc.commandparser.BaseCommandInfo;
27 28
 import com.dmdirc.commandparser.CommandArguments;
28 29
 import com.dmdirc.commandparser.CommandInfo;
29 30
 import com.dmdirc.commandparser.CommandType;
@@ -45,8 +46,12 @@ import java.util.regex.Pattern;
45 46
 /**
46 47
  * The new server command allows users to open a new server window.
47 48
  */
48
-public class NewServer extends Command implements IntelligentCommand,
49
-        CommandInfo {
49
+public class NewServer extends Command implements IntelligentCommand {
50
+
51
+    /** A command info object for this command. */
52
+    public static final CommandInfo INFO = new BaseCommandInfo("newserver",
53
+            "newserver <host[:[+]port]> [password] - connect to a new server",
54
+            CommandType.TYPE_GLOBAL);
50 55
 
51 56
     /** {@inheritDoc} */
52 57
     @Override
@@ -212,30 +217,6 @@ public class NewServer extends Command implements IntelligentCommand,
212 217
         }
213 218
     }
214 219
 
215
-    /** {@inheritDoc} */
216
-    @Override
217
-    public String getName() {
218
-        return "newserver";
219
-    }
220
-
221
-    /** {@inheritDoc} */
222
-    @Override
223
-    public boolean showInHelp() {
224
-        return true;
225
-    }
226
-
227
-    /** {@inheritDoc} */
228
-    @Override
229
-    public CommandType getType() {
230
-        return CommandType.TYPE_GLOBAL;
231
-    }
232
-
233
-    /** {@inheritDoc} */
234
-    @Override
235
-    public String getHelp() {
236
-        return "newserver <host[:[+]port]> [password] - connect to a new server";
237
-    }
238
-
239 220
     /** {@inheritDoc} */
240 221
     @Override
241 222
     public AdditionalTabTargets getSuggestions(final int arg,

+ 7
- 26
src/com/dmdirc/commandparser/commands/global/Notify.java 查看文件

@@ -23,6 +23,7 @@
23 23
 package com.dmdirc.commandparser.commands.global;
24 24
 
25 25
 import com.dmdirc.FrameContainer;
26
+import com.dmdirc.commandparser.BaseCommandInfo;
26 27
 import com.dmdirc.commandparser.CommandArguments;
27 28
 import com.dmdirc.commandparser.CommandInfo;
28 29
 import com.dmdirc.commandparser.CommandType;
@@ -38,8 +39,12 @@ import java.awt.Color;
38 39
  * The notify command allows the user to set the notification colour for a
39 40
  * window.
40 41
  */
41
-public class Notify extends Command implements IntelligentCommand,
42
-        CommandInfo {
42
+public class Notify extends Command implements IntelligentCommand {
43
+
44
+    /** A command info object for this command. */
45
+    public static final CommandInfo INFO = new BaseCommandInfo("notify",
46
+            "notify <colour> - sets the notification colour for this window",
47
+            CommandType.TYPE_GLOBAL);
43 48
 
44 49
     /** {@inheritDoc} */
45 50
     @Override
@@ -63,30 +68,6 @@ public class Notify extends Command implements IntelligentCommand,
63 68
         }
64 69
     }
65 70
 
66
-    /** {@inheritDoc} */
67
-    @Override
68
-    public String getName() {
69
-        return "notify";
70
-    }
71
-
72
-    /** {@inheritDoc} */
73
-    @Override
74
-    public boolean showInHelp() {
75
-        return false;
76
-    }
77
-
78
-    /** {@inheritDoc} */
79
-    @Override
80
-    public CommandType getType() {
81
-        return CommandType.TYPE_GLOBAL;
82
-    }
83
-
84
-    /** {@inheritDoc} */
85
-    @Override
86
-    public String getHelp() {
87
-        return "notify <colour> - sets the notification colour for this window";
88
-    }
89
-
90 71
     /** {@inheritDoc} */
91 72
     @Override
92 73
     public AdditionalTabTargets getSuggestions(final int arg,

+ 8
- 26
src/com/dmdirc/commandparser/commands/global/OpenWindow.java 查看文件

@@ -24,6 +24,7 @@ package com.dmdirc.commandparser.commands.global;
24 24
 
25 25
 import com.dmdirc.CustomWindow;
26 26
 import com.dmdirc.FrameContainer;
27
+import com.dmdirc.commandparser.BaseCommandInfo;
27 28
 import com.dmdirc.commandparser.CommandArguments;
28 29
 import com.dmdirc.commandparser.CommandInfo;
29 30
 import com.dmdirc.commandparser.CommandType;
@@ -36,7 +37,13 @@ import com.dmdirc.ui.input.AdditionalTabTargets;
36 37
 /**
37 38
  * Opens a new window.
38 39
  */
39
-public class OpenWindow extends Command implements IntelligentCommand, CommandInfo {
40
+public class OpenWindow extends Command implements IntelligentCommand {
41
+
42
+    /** A command info object for this command. */
43
+    public static final CommandInfo INFO = new BaseCommandInfo("openwindow",
44
+            "openwindow [--server|--child] <name> [title] "
45
+            + "- opens a window with the specified name and title",
46
+            CommandType.TYPE_GLOBAL);
40 47
 
41 48
     /** {@inheritDoc} */
42 49
     @Override
@@ -87,31 +94,6 @@ public class OpenWindow extends Command implements IntelligentCommand, CommandIn
87 94
         }
88 95
     }
89 96
 
90
-    /** {@inheritDoc} */
91
-    @Override
92
-    public String getHelp() {
93
-        return "openwindow [--server|--child] <name> [title] "
94
-                + "- opens a window with the specified name and title";
95
-    }
96
-
97
-    /** {@inheritDoc} */
98
-    @Override
99
-    public String getName() {
100
-        return "openwindow";
101
-    }
102
-
103
-    /** {@inheritDoc} */
104
-    @Override
105
-    public CommandType getType() {
106
-        return CommandType.TYPE_GLOBAL;
107
-    }
108
-
109
-    /** {@inheritDoc} */
110
-    @Override
111
-    public boolean showInHelp() {
112
-        return true;
113
-    }
114
-
115 97
     /** {@inheritDoc} */
116 98
     @Override
117 99
     public AdditionalTabTargets getSuggestions(final int arg,

+ 7
- 26
src/com/dmdirc/commandparser/commands/global/ReloadActions.java 查看文件

@@ -24,6 +24,7 @@ package com.dmdirc.commandparser.commands.global;
24 24
 
25 25
 import com.dmdirc.FrameContainer;
26 26
 import com.dmdirc.actions.ActionManager;
27
+import com.dmdirc.commandparser.BaseCommandInfo;
27 28
 import com.dmdirc.commandparser.CommandArguments;
28 29
 import com.dmdirc.commandparser.CommandInfo;
29 30
 import com.dmdirc.commandparser.CommandType;
@@ -35,8 +36,12 @@ import com.dmdirc.ui.input.AdditionalTabTargets;
35 36
 /**
36 37
  * Allows the user to reload actions.
37 38
  */
38
-public final class ReloadActions extends Command implements IntelligentCommand,
39
-        CommandInfo {
39
+public final class ReloadActions extends Command implements IntelligentCommand {
40
+
41
+    /** A command info object for this command. */
42
+    public static final CommandInfo INFO = new BaseCommandInfo("reloadactions",
43
+            "reloadactions - reloads actions from disk",
44
+            CommandType.TYPE_GLOBAL);
40 45
 
41 46
     /** {@inheritDoc} */
42 47
     @Override
@@ -46,30 +51,6 @@ public final class ReloadActions extends Command implements IntelligentCommand,
46 51
         sendLine(origin, args.isSilent(), FORMAT_OUTPUT, "Actions reloaded.");
47 52
     }
48 53
 
49
-    /** {@inheritDoc}. */
50
-    @Override
51
-    public String getName() {
52
-        return "reloadactions";
53
-    }
54
-
55
-    /** {@inheritDoc}. */
56
-    @Override
57
-    public boolean showInHelp() {
58
-        return true;
59
-    }
60
-
61
-    /** {@inheritDoc} */
62
-    @Override
63
-    public CommandType getType() {
64
-        return CommandType.TYPE_GLOBAL;
65
-    }
66
-
67
-    /** {@inheritDoc}. */
68
-    @Override
69
-    public String getHelp() {
70
-        return "reloadactions - reloads actions from disk";
71
-    }
72
-
73 54
     /** {@inheritDoc} */
74 55
     @Override
75 56
     public AdditionalTabTargets getSuggestions(final int arg,

+ 7
- 26
src/com/dmdirc/commandparser/commands/global/ReloadIdentities.java 查看文件

@@ -23,6 +23,7 @@
23 23
 package com.dmdirc.commandparser.commands.global;
24 24
 
25 25
 import com.dmdirc.FrameContainer;
26
+import com.dmdirc.commandparser.BaseCommandInfo;
26 27
 import com.dmdirc.commandparser.CommandArguments;
27 28
 import com.dmdirc.commandparser.CommandInfo;
28 29
 import com.dmdirc.commandparser.CommandType;
@@ -35,8 +36,12 @@ import com.dmdirc.ui.input.AdditionalTabTargets;
35 36
 /**
36 37
  * Allows the user to reload identities.
37 38
  */
38
-public class ReloadIdentities extends Command implements IntelligentCommand,
39
-        CommandInfo {
39
+public class ReloadIdentities extends Command implements IntelligentCommand {
40
+
41
+    /** A command info object for this command. */
42
+    public static final CommandInfo INFO = new BaseCommandInfo("reloadidentities",
43
+            "reloadidentities - reloads user identities (configuration files)",
44
+            CommandType.TYPE_GLOBAL);
40 45
 
41 46
     /** {@inheritDoc} */
42 47
     @Override
@@ -47,30 +52,6 @@ public class ReloadIdentities extends Command implements IntelligentCommand,
47 52
         sendLine(origin, args.isSilent(), FORMAT_OUTPUT, "Identities reloaded.");
48 53
     }
49 54
 
50
-    /** {@inheritDoc} */
51
-    @Override
52
-    public String getName() {
53
-        return "reloadidentities";
54
-    }
55
-
56
-    /** {@inheritDoc} */
57
-    @Override
58
-    public boolean showInHelp() {
59
-        return true;
60
-    }
61
-
62
-    /** {@inheritDoc} */
63
-    @Override
64
-    public CommandType getType() {
65
-        return CommandType.TYPE_GLOBAL;
66
-    }
67
-
68
-    /** {@inheritDoc} */
69
-    @Override
70
-    public String getHelp() {
71
-        return "reloadidentities - reloads user identities (configuration files)";
72
-    }
73
-
74 55
     /** {@inheritDoc} */
75 56
     @Override
76 57
     public AdditionalTabTargets getSuggestions(final int arg,

+ 7
- 26
src/com/dmdirc/commandparser/commands/global/ReloadPlugin.java 查看文件

@@ -23,6 +23,7 @@
23 23
 package com.dmdirc.commandparser.commands.global;
24 24
 
25 25
 import com.dmdirc.FrameContainer;
26
+import com.dmdirc.commandparser.BaseCommandInfo;
26 27
 import com.dmdirc.commandparser.CommandArguments;
27 28
 import com.dmdirc.commandparser.CommandInfo;
28 29
 import com.dmdirc.commandparser.CommandType;
@@ -36,8 +37,12 @@ import com.dmdirc.ui.input.AdditionalTabTargets;
36 37
 /**
37 38
  * Allows the user to reload a plugin.
38 39
  */
39
-public class ReloadPlugin extends Command implements IntelligentCommand,
40
-        CommandInfo {
40
+public class ReloadPlugin extends Command implements IntelligentCommand {
41
+
42
+    /** A command info object for this command. */
43
+    public static final CommandInfo INFO = new BaseCommandInfo("reloadplugin",
44
+            "reloadplugin <plugin> - Reloads the specified plugin",
45
+            CommandType.TYPE_GLOBAL);
41 46
 
42 47
     /** {@inheritDoc} */
43 48
     @Override
@@ -60,30 +65,6 @@ public class ReloadPlugin extends Command implements IntelligentCommand,
60 65
         }
61 66
     }
62 67
 
63
-    /** {@inheritDoc} */
64
-    @Override
65
-    public String getName() {
66
-        return "reloadplugin";
67
-    }
68
-
69
-    /** {@inheritDoc} */
70
-    @Override
71
-    public boolean showInHelp() {
72
-        return true;
73
-    }
74
-
75
-    /** {@inheritDoc} */
76
-    @Override
77
-    public CommandType getType() {
78
-        return CommandType.TYPE_GLOBAL;
79
-    }
80
-
81
-    /** {@inheritDoc} */
82
-    @Override
83
-    public String getHelp() {
84
-        return "reloadplugin <plugin> - Reloads the specified plugin";
85
-    }
86
-
87 68
     /** {@inheritDoc} */
88 69
     @Override
89 70
     public AdditionalTabTargets getSuggestions(final int arg,

+ 7
- 26
src/com/dmdirc/commandparser/commands/global/SaveConfig.java 查看文件

@@ -23,6 +23,7 @@
23 23
 package com.dmdirc.commandparser.commands.global;
24 24
 
25 25
 import com.dmdirc.FrameContainer;
26
+import com.dmdirc.commandparser.BaseCommandInfo;
26 27
 import com.dmdirc.commandparser.CommandArguments;
27 28
 import com.dmdirc.commandparser.CommandInfo;
28 29
 import com.dmdirc.commandparser.CommandType;
@@ -35,8 +36,12 @@ import com.dmdirc.ui.input.AdditionalTabTargets;
35 36
 /**
36 37
  * Allows the user to save the config file.
37 38
  */
38
-public final class SaveConfig extends Command implements IntelligentCommand,
39
-        CommandInfo {
39
+public final class SaveConfig extends Command implements IntelligentCommand {
40
+
41
+    /** A command info object for this command. */
42
+    public static final CommandInfo INFO = new BaseCommandInfo("saveconfig",
43
+            "saveconfig - force the client to save its configuration to disk",
44
+            CommandType.TYPE_GLOBAL);
40 45
 
41 46
     /** {@inheritDoc} */
42 47
     @Override
@@ -47,30 +52,6 @@ public final class SaveConfig extends Command implements IntelligentCommand,
47 52
         sendLine(origin, args.isSilent(), FORMAT_OUTPUT, "Configuration file saved.");
48 53
     }
49 54
 
50
-    /** {@inheritDoc} */
51
-    @Override
52
-    public String getName() {
53
-        return "saveconfig";
54
-    }
55
-
56
-    /** {@inheritDoc} */
57
-    @Override
58
-    public boolean showInHelp() {
59
-        return true;
60
-    }
61
-
62
-    /** {@inheritDoc} */
63
-    @Override
64
-    public CommandType getType() {
65
-        return CommandType.TYPE_GLOBAL;
66
-    }
67
-
68
-    /** {@inheritDoc} */
69
-    @Override
70
-    public String getHelp() {
71
-        return "saveconfig - force the client to save its configuration to disk";
72
-    }
73
-
74 55
     /** {@inheritDoc} */
75 56
     @Override
76 57
     public AdditionalTabTargets getSuggestions(final int arg,

+ 9
- 27
src/com/dmdirc/commandparser/commands/global/Set.java 查看文件

@@ -24,6 +24,7 @@ package com.dmdirc.commandparser.commands.global;
24 24
 
25 25
 import com.dmdirc.Channel;
26 26
 import com.dmdirc.FrameContainer;
27
+import com.dmdirc.commandparser.BaseCommandInfo;
27 28
 import com.dmdirc.commandparser.CommandArguments;
28 29
 import com.dmdirc.commandparser.CommandInfo;
29 30
 import com.dmdirc.commandparser.CommandManager;
@@ -45,7 +46,14 @@ import java.util.List;
45 46
 /**
46 47
  * The set command allows the user to inspect and change global config settings.
47 48
  */
48
-public class Set extends Command implements IntelligentCommand, CommandInfo {
49
+public class Set extends Command implements IntelligentCommand {
50
+
51
+    /** A command info object for this command. */
52
+    public static final CommandInfo INFO = new BaseCommandInfo("set",
53
+            "set [--server|--channel] [domain [option [newvalue]]] - inspect or change configuration settings"
54
+            + "\nset [--server|--channel] --append <domain> <option> <data> - appends data to the specified option"
55
+            + "\nset [--server|--channel] --unset <domain> <option> - unsets the specified option",
56
+            CommandType.TYPE_GLOBAL);
49 57
 
50 58
     /** The flag to indicate the set command should apply to a server's settings. */
51 59
     private final CommandFlag serverFlag = new CommandFlag("server");
@@ -273,32 +281,6 @@ public class Set extends Command implements IntelligentCommand, CommandInfo {
273 281
         sendLine(origin, isSilent, FORMAT_OUTPUT, domain + "." + option + " has been unset.");
274 282
     }
275 283
 
276
-    /** {@inheritDoc} */
277
-    @Override
278
-    public String getName() {
279
-        return "set";
280
-    }
281
-
282
-    /** {@inheritDoc} */
283
-    @Override
284
-    public boolean showInHelp() {
285
-        return true;
286
-    }
287
-
288
-    /** {@inheritDoc} */
289
-    @Override
290
-    public CommandType getType() {
291
-        return CommandType.TYPE_GLOBAL;
292
-    }
293
-
294
-    /** {@inheritDoc} */
295
-    @Override
296
-    public String getHelp() {
297
-        return "set [--server|--channel] [domain [option [newvalue]]] - inspect or change configuration settings"
298
-                + "\nset [--server|--channel] --append <domain> <option> <data> - appends data to the specified option"
299
-                + "\nset [--server|--channel] --unset <domain> <option> - unsets the specified option";
300
-    }
301
-
302 284
     /** {@inheritDoc} */
303 285
     @Override
304 286
     public AdditionalTabTargets getSuggestions(final int arg,

+ 7
- 26
src/com/dmdirc/commandparser/commands/global/UnloadPlugin.java 查看文件

@@ -23,6 +23,7 @@
23 23
 package com.dmdirc.commandparser.commands.global;
24 24
 
25 25
 import com.dmdirc.FrameContainer;
26
+import com.dmdirc.commandparser.BaseCommandInfo;
26 27
 import com.dmdirc.commandparser.CommandArguments;
27 28
 import com.dmdirc.commandparser.CommandInfo;
28 29
 import com.dmdirc.commandparser.CommandType;
@@ -36,8 +37,12 @@ import com.dmdirc.ui.input.AdditionalTabTargets;
36 37
 /**
37 38
  * Allows the user to unload a plugin.
38 39
  */
39
-public class UnloadPlugin extends Command implements IntelligentCommand,
40
-        CommandInfo {
40
+public class UnloadPlugin extends Command implements IntelligentCommand {
41
+
42
+    /** A command info object for this command. */
43
+    public static final CommandInfo INFO = new BaseCommandInfo("unloadplugin",
44
+            "unloadplugin <plugin> - Unloads the specified plugin",
45
+            CommandType.TYPE_GLOBAL);
41 46
 
42 47
     /** {@inheritDoc} */
43 48
     @Override
@@ -60,30 +65,6 @@ public class UnloadPlugin extends Command implements IntelligentCommand,
60 65
         }
61 66
     }
62 67
 
63
-    /** {@inheritDoc} */
64
-    @Override
65
-    public String getName() {
66
-        return "unloadplugin";
67
-    }
68
-
69
-    /** {@inheritDoc} */
70
-    @Override
71
-    public boolean showInHelp() {
72
-        return true;
73
-    }
74
-
75
-    /** {@inheritDoc} */
76
-    @Override
77
-    public CommandType getType() {
78
-        return CommandType.TYPE_GLOBAL;
79
-    }
80
-
81
-    /** {@inheritDoc} */
82
-    @Override
83
-    public String getHelp() {
84
-        return "unloadplugin <plugin> - Unloads the specified plugin";
85
-    }
86
-
87 68
     /** {@inheritDoc} */
88 69
     @Override
89 70
     public AdditionalTabTargets getSuggestions(final int arg,

+ 7
- 27
src/com/dmdirc/commandparser/commands/server/AllChannels.java 查看文件

@@ -24,6 +24,7 @@ package com.dmdirc.commandparser.commands.server;
24 24
 
25 25
 import com.dmdirc.FrameContainer;
26 26
 import com.dmdirc.Server;
27
+import com.dmdirc.commandparser.BaseCommandInfo;
27 28
 import com.dmdirc.commandparser.CommandArguments;
28 29
 import com.dmdirc.commandparser.CommandInfo;
29 30
 import com.dmdirc.commandparser.CommandType;
@@ -38,8 +39,12 @@ import com.dmdirc.ui.input.TabCompleter;
38 39
  * The AllChannels command allows the user to issue a command to all channels
39 40
  * on a server.
40 41
  */
41
-public class AllChannels extends Command implements IntelligentCommand,
42
-        CommandInfo {
42
+public class AllChannels extends Command implements IntelligentCommand {
43
+
44
+    /** A command info object for this command. */
45
+    public static final CommandInfo INFO = new BaseCommandInfo("allchannels",
46
+           "allchannels <command> - executes the command as though it had"
47
+            + " been entered on all channels", CommandType.TYPE_SERVER);
43 48
 
44 49
     /** {@inheritDoc} */
45 50
     @Override
@@ -54,31 +59,6 @@ public class AllChannels extends Command implements IntelligentCommand,
54 59
         }
55 60
     }
56 61
 
57
-    /** {@inheritDoc} */
58
-    @Override
59
-    public String getName() {
60
-        return "allchannels";
61
-    }
62
-
63
-    /** {@inheritDoc} */
64
-    @Override
65
-    public boolean showInHelp() {
66
-        return true;
67
-    }
68
-
69
-    /** {@inheritDoc} */
70
-    @Override
71
-    public CommandType getType() {
72
-        return CommandType.TYPE_SERVER;
73
-    }
74
-
75
-    /** {@inheritDoc} */
76
-    @Override
77
-    public String getHelp() {
78
-        return "allchannels <command> - executes the command as though it had"
79
-                + " been entered on all channels";
80
-    }
81
-
82 62
     /** {@inheritDoc} */
83 63
     @Override
84 64
     public AdditionalTabTargets getSuggestions(final int arg,

+ 6
- 25
src/com/dmdirc/commandparser/commands/server/Away.java 查看文件

@@ -24,6 +24,7 @@ package com.dmdirc.commandparser.commands.server;
24 24
 
25 25
 import com.dmdirc.FrameContainer;
26 26
 import com.dmdirc.Server;
27
+import com.dmdirc.commandparser.BaseCommandInfo;
27 28
 import com.dmdirc.commandparser.CommandArguments;
28 29
 import com.dmdirc.commandparser.CommandInfo;
29 30
 import com.dmdirc.commandparser.CommandType;
@@ -36,7 +37,11 @@ import com.dmdirc.commandparser.commands.context.ServerCommandContext;
36 37
  * The away command allows the user to set their away message.
37 38
  */
38 39
 @CommandOptions(allowOffline = false)
39
-public class Away extends Command implements CommandInfo {
40
+public class Away extends Command {
41
+
42
+    /** A command info object for this command. */
43
+    public static final CommandInfo INFO = new BaseCommandInfo("away",
44
+           "away <reason> - marks you as away", CommandType.TYPE_SERVER);
40 45
 
41 46
     /** {@inheritDoc} */
42 47
     @Override
@@ -52,28 +57,4 @@ public class Away extends Command implements CommandInfo {
52 57
         }
53 58
     }
54 59
 
55
-    /** {@inheritDoc} */
56
-    @Override
57
-    public String getName() {
58
-        return "away";
59
-    }
60
-
61
-    /** {@inheritDoc} */
62
-    @Override
63
-    public boolean showInHelp() {
64
-        return true;
65
-    }
66
-
67
-    /** {@inheritDoc} */
68
-    @Override
69
-    public CommandType getType() {
70
-        return CommandType.TYPE_SERVER;
71
-    }
72
-
73
-    /** {@inheritDoc} */
74
-    @Override
75
-    public String getHelp() {
76
-        return "away <reason> - marks you as away";
77
-    }
78
-
79 60
 }

+ 6
- 25
src/com/dmdirc/commandparser/commands/server/Back.java 查看文件

@@ -24,6 +24,7 @@ package com.dmdirc.commandparser.commands.server;
24 24
 
25 25
 import com.dmdirc.FrameContainer;
26 26
 import com.dmdirc.Server;
27
+import com.dmdirc.commandparser.BaseCommandInfo;
27 28
 import com.dmdirc.commandparser.CommandArguments;
28 29
 import com.dmdirc.commandparser.CommandInfo;
29 30
 import com.dmdirc.commandparser.CommandType;
@@ -38,7 +39,11 @@ import com.dmdirc.ui.input.AdditionalTabTargets;
38 39
  * The back command allows the user to unset their away status.
39 40
  */
40 41
 @CommandOptions(allowOffline = false)
41
-public class Back extends Command implements IntelligentCommand, CommandInfo {
42
+public class Back extends Command implements IntelligentCommand {
43
+
44
+    /** A command info object for this command. */
45
+    public static final CommandInfo INFO = new BaseCommandInfo("back",
46
+           "back - unsets your away status", CommandType.TYPE_SERVER);
42 47
 
43 48
     /** {@inheritDoc} */
44 49
     @Override
@@ -48,30 +53,6 @@ public class Back extends Command implements IntelligentCommand, CommandInfo {
48 53
         server.getParser().getLocalClient().setBack();
49 54
     }
50 55
 
51
-    /** {@inheritDoc}. */
52
-    @Override
53
-    public String getName() {
54
-        return "back";
55
-    }
56
-
57
-    /** {@inheritDoc}. */
58
-    @Override
59
-    public boolean showInHelp() {
60
-        return true;
61
-    }
62
-
63
-    /** {@inheritDoc} */
64
-    @Override
65
-    public CommandType getType() {
66
-        return CommandType.TYPE_SERVER;
67
-    }
68
-
69
-    /** {@inheritDoc}. */
70
-    @Override
71
-    public String getHelp() {
72
-        return "back - unsets your away status";
73
-    }
74
-
75 56
     /** {@inheritDoc} */
76 57
     @Override
77 58
     public AdditionalTabTargets getSuggestions(final int arg,

+ 7
- 25
src/com/dmdirc/commandparser/commands/server/ChangeServer.java 查看文件

@@ -24,6 +24,7 @@ package com.dmdirc.commandparser.commands.server;
24 24
 
25 25
 import com.dmdirc.FrameContainer;
26 26
 import com.dmdirc.Server;
27
+import com.dmdirc.commandparser.BaseCommandInfo;
27 28
 import com.dmdirc.commandparser.CommandArguments;
28 29
 import com.dmdirc.commandparser.CommandInfo;
29 30
 import com.dmdirc.commandparser.CommandType;
@@ -38,7 +39,12 @@ import java.net.URISyntaxException;
38 39
 /**
39 40
  * The /server command allows the user to connect to a new server.
40 41
  */
41
-public class ChangeServer extends Command implements CommandInfo {
42
+public class ChangeServer extends Command {
43
+
44
+    /** A command info object for this command. */
45
+    public static final CommandInfo INFO = new BaseCommandInfo("server",
46
+            "server <host[:[+]port]> [password] - connect to a different server",
47
+            CommandType.TYPE_SERVER);
42 48
 
43 49
     /** {@inheritDoc} */
44 50
     @Override
@@ -68,28 +74,4 @@ public class ChangeServer extends Command implements CommandInfo {
68 74
         server.connect(address, server.getProfile());
69 75
     }
70 76
 
71
-    /** {@inheritDoc} */
72
-    @Override
73
-    public String getName() {
74
-        return "server";
75
-    }
76
-
77
-    /** {@inheritDoc} */
78
-    @Override
79
-    public boolean showInHelp() {
80
-        return true;
81
-    }
82
-
83
-    /** {@inheritDoc} */
84
-    @Override
85
-    public CommandType getType() {
86
-        return CommandType.TYPE_SERVER;
87
-    }
88
-
89
-    /** {@inheritDoc} */
90
-    @Override
91
-    public String getHelp() {
92
-        return "server <host[:[+]port]> [password] - connect to a different server";
93
-    }
94
-
95 77
 }

+ 7
- 26
src/com/dmdirc/commandparser/commands/server/Ctcp.java 查看文件

@@ -24,6 +24,7 @@ package com.dmdirc.commandparser.commands.server;
24 24
 
25 25
 import com.dmdirc.FrameContainer;
26 26
 import com.dmdirc.Server;
27
+import com.dmdirc.commandparser.BaseCommandInfo;
27 28
 import com.dmdirc.commandparser.CommandArguments;
28 29
 import com.dmdirc.commandparser.CommandInfo;
29 30
 import com.dmdirc.commandparser.CommandType;
@@ -39,8 +40,12 @@ import com.dmdirc.ui.input.TabCompletionType;
39 40
  * Allows the user to send CTCP messages.
40 41
  */
41 42
 @CommandOptions(allowOffline = false)
42
-public class Ctcp extends Command implements IntelligentCommand,
43
-        CommandInfo {
43
+public class Ctcp extends Command implements IntelligentCommand {
44
+
45
+    /** A command info object for this command. */
46
+    public static final CommandInfo INFO = new BaseCommandInfo("ctcp",
47
+            "ctcp <target> <type> [arguments] - sends a CTCP message",
48
+            CommandType.TYPE_SERVER);
44 49
 
45 50
     /** {@inheritDoc} */
46 51
     @Override
@@ -57,30 +62,6 @@ public class Ctcp extends Command implements IntelligentCommand,
57 62
         }
58 63
     }
59 64
 
60
-    /** {@inheritDoc}. */
61
-    @Override
62
-    public String getName() {
63
-        return "ctcp";
64
-    }
65
-
66
-    /** {@inheritDoc}. */
67
-    @Override
68
-    public boolean showInHelp() {
69
-        return true;
70
-    }
71
-
72
-    /** {@inheritDoc} */
73
-    @Override
74
-    public CommandType getType() {
75
-        return CommandType.TYPE_SERVER;
76
-    }
77
-
78
-    /** {@inheritDoc}. */
79
-    @Override
80
-    public String getHelp() {
81
-        return "ctcp <target> <type> [arguments] - sends a CTCP message";
82
-    }
83
-
84 65
     /** {@inheritDoc} */
85 66
     @Override
86 67
     public AdditionalTabTargets getSuggestions(final int arg,

+ 7
- 25
src/com/dmdirc/commandparser/commands/server/Disconnect.java 查看文件

@@ -24,6 +24,7 @@ package com.dmdirc.commandparser.commands.server;
24 24
 
25 25
 import com.dmdirc.FrameContainer;
26 26
 import com.dmdirc.Server;
27
+import com.dmdirc.commandparser.BaseCommandInfo;
27 28
 import com.dmdirc.commandparser.CommandArguments;
28 29
 import com.dmdirc.commandparser.CommandInfo;
29 30
 import com.dmdirc.commandparser.CommandType;
@@ -34,7 +35,12 @@ import com.dmdirc.commandparser.commands.context.ServerCommandContext;
34 35
 /**
35 36
  * The disconnect command disconnects from the current server.
36 37
  */
37
-public class Disconnect extends Command implements CommandInfo {
38
+public class Disconnect extends Command {
39
+
40
+    /** A command info object for this command. */
41
+    public static final CommandInfo INFO = new BaseCommandInfo("disconnect",
42
+            "disconnect [reason] - disconnect from this server",
43
+            CommandType.TYPE_SERVER);
38 44
 
39 45
     /** {@inheritDoc} */
40 46
     @Override
@@ -52,28 +58,4 @@ public class Disconnect extends Command implements CommandInfo {
52 58
         server.disconnect(line);
53 59
     }
54 60
 
55
-    /** {@inheritDoc} */
56
-    @Override
57
-    public String getName() {
58
-        return "disconnect";
59
-    }
60
-
61
-    /** {@inheritDoc} */
62
-    @Override
63
-    public boolean showInHelp() {
64
-        return true;
65
-    }
66
-
67
-    /** {@inheritDoc} */
68
-    @Override
69
-    public CommandType getType() {
70
-        return CommandType.TYPE_SERVER;
71
-    }
72
-
73
-    /** {@inheritDoc} */
74
-    @Override
75
-    public String getHelp() {
76
-        return "disconnect [reason] - disconnect from this server";
77
-    }
78
-
79 61
 }

+ 7
- 26
src/com/dmdirc/commandparser/commands/server/Ignore.java 查看文件

@@ -24,6 +24,7 @@ package com.dmdirc.commandparser.commands.server;
24 24
 
25 25
 import com.dmdirc.FrameContainer;
26 26
 import com.dmdirc.Server;
27
+import com.dmdirc.commandparser.BaseCommandInfo;
27 28
 import com.dmdirc.commandparser.CommandArguments;
28 29
 import com.dmdirc.commandparser.CommandInfo;
29 30
 import com.dmdirc.commandparser.CommandType;
@@ -42,8 +43,12 @@ import java.util.regex.PatternSyntaxException;
42 43
 /**
43 44
  * Allows the user to add/view/delete ignores.
44 45
  */
45
-public class Ignore extends Command implements IntelligentCommand,
46
-        CommandInfo {
46
+public class Ignore extends Command implements IntelligentCommand {
47
+
48
+    /** A command info object for this command. */
49
+    public static final CommandInfo INFO = new BaseCommandInfo("ignore",
50
+            "ignore [--remove|--regex] [host] - manages the network's ignore list",
51
+            CommandType.TYPE_SERVER);
47 52
 
48 53
     /** {@inheritDoc} */
49 54
     @Override
@@ -149,30 +154,6 @@ public class Ignore extends Command implements IntelligentCommand,
149 154
         sendLine(origin, args.isSilent(), FORMAT_ERROR, "Ignore list doesn't contain '" + host + "'.");
150 155
     }
151 156
 
152
-    /** {@inheritDoc} */
153
-    @Override
154
-    public String getName() {
155
-        return "ignore";
156
-    }
157
-
158
-    /** {@inheritDoc} */
159
-    @Override
160
-    public boolean showInHelp() {
161
-        return true;
162
-    }
163
-
164
-    /** {@inheritDoc} */
165
-    @Override
166
-    public CommandType getType() {
167
-        return CommandType.TYPE_SERVER;
168
-    }
169
-
170
-    /** {@inheritDoc} */
171
-    @Override
172
-    public String getHelp() {
173
-        return "ignore [--remove|--regex] [host] - manages the network's ignore list";
174
-    }
175
-
176 157
     /** {@inheritDoc} */
177 158
     @Override
178 159
     public AdditionalTabTargets getSuggestions(final int arg,

+ 7
- 25
src/com/dmdirc/commandparser/commands/server/JoinChannelCommand.java 查看文件

@@ -27,6 +27,7 @@ import com.dmdirc.Server;
27 27
 import com.dmdirc.actions.ActionManager;
28 28
 import com.dmdirc.actions.CoreActionType;
29 29
 import com.dmdirc.actions.interfaces.ActionType;
30
+import com.dmdirc.commandparser.BaseCommandInfo;
30 31
 import com.dmdirc.commandparser.CommandArguments;
31 32
 import com.dmdirc.commandparser.CommandInfo;
32 33
 import com.dmdirc.commandparser.CommandType;
@@ -49,7 +50,12 @@ import java.util.List;
49 50
  * @since 0.6.3m1
50 51
  */
51 52
 public class JoinChannelCommand extends Command implements
52
-        ActionListener, IntelligentCommand, CommandInfo {
53
+        ActionListener, IntelligentCommand {
54
+
55
+    /** A command info object for this command. */
56
+    public static final CommandInfo INFO = new BaseCommandInfo("join",
57
+            "join <channel [key]>[,channel [key]...] - joins the specified channel(s)",
58
+            CommandType.TYPE_SERVER);
53 59
 
54 60
     /** A map of channel name mentions. */
55 61
     private final MapList<FrameContainer, String> mentions
@@ -91,30 +97,6 @@ public class JoinChannelCommand extends Command implements
91 97
         server.join(!args.isSilent(), channels.toArray(new ChannelJoinRequest[0]));
92 98
     }
93 99
 
94
-    /** {@inheritDoc} */
95
-    @Override
96
-    public String getName() {
97
-        return "join";
98
-    }
99
-
100
-    /** {@inheritDoc} */
101
-    @Override
102
-    public boolean showInHelp() {
103
-        return true;
104
-    }
105
-
106
-    /** {@inheritDoc} */
107
-    @Override
108
-    public CommandType getType() {
109
-        return CommandType.TYPE_SERVER;
110
-    }
111
-
112
-    /** {@inheritDoc} */
113
-    @Override
114
-    public String getHelp() {
115
-        return "join <channel [key]>[,channel [key]...] - joins the specified channel(s)";
116
-    }
117
-
118 100
     /** {@inheritDoc} */
119 101
     @Override
120 102
     public void processEvent(final ActionType type, final StringBuffer format,

+ 7
- 25
src/com/dmdirc/commandparser/commands/server/Message.java 查看文件

@@ -24,6 +24,7 @@ package com.dmdirc.commandparser.commands.server;
24 24
 
25 25
 import com.dmdirc.FrameContainer;
26 26
 import com.dmdirc.Server;
27
+import com.dmdirc.commandparser.BaseCommandInfo;
27 28
 import com.dmdirc.commandparser.CommandArguments;
28 29
 import com.dmdirc.commandparser.CommandInfo;
29 30
 import com.dmdirc.commandparser.CommandType;
@@ -43,7 +44,12 @@ import com.dmdirc.ui.interfaces.InputWindow;
43 44
  */
44 45
 @CommandOptions(allowOffline = false)
45 46
 public class Message extends Command implements IntelligentCommand,
46
-        WrappableCommand, CommandInfo {
47
+        WrappableCommand {
48
+
49
+    /** A command info object for this command. */
50
+    public static final CommandInfo INFO = new BaseCommandInfo("msg",
51
+            "msg <target> <message> - sends a private message",
52
+            CommandType.TYPE_SERVER);
47 53
 
48 54
     /** {@inheritDoc} */
49 55
     @Override
@@ -79,30 +85,6 @@ public class Message extends Command implements IntelligentCommand,
79 85
         }
80 86
     }
81 87
 
82
-    /** {@inheritDoc} */
83
-    @Override
84
-    public String getName() {
85
-        return "msg";
86
-    }
87
-
88
-    /** {@inheritDoc} */
89
-    @Override
90
-    public boolean showInHelp() {
91
-        return true;
92
-    }
93
-
94
-    /** {@inheritDoc} */
95
-    @Override
96
-    public CommandType getType() {
97
-        return CommandType.TYPE_SERVER;
98
-    }
99
-
100
-    /** {@inheritDoc} */
101
-    @Override
102
-    public String getHelp() {
103
-        return "msg <target> <message> - sends a private message";
104
-    }
105
-
106 88
     /** {@inheritDoc} */
107 89
     @Override
108 90
     public AdditionalTabTargets getSuggestions(final int arg,

+ 7
- 26
src/com/dmdirc/commandparser/commands/server/Nick.java 查看文件

@@ -24,6 +24,7 @@ package com.dmdirc.commandparser.commands.server;
24 24
 
25 25
 import com.dmdirc.FrameContainer;
26 26
 import com.dmdirc.Server;
27
+import com.dmdirc.commandparser.BaseCommandInfo;
27 28
 import com.dmdirc.commandparser.CommandArguments;
28 29
 import com.dmdirc.commandparser.CommandInfo;
29 30
 import com.dmdirc.commandparser.CommandType;
@@ -39,8 +40,12 @@ import com.dmdirc.ui.input.TabCompletionType;
39 40
  * Allows the user to change nickname.
40 41
  */
41 42
 @CommandOptions(allowOffline = false)
42
-public class Nick extends Command implements IntelligentCommand,
43
-        CommandInfo {
43
+public class Nick extends Command implements IntelligentCommand {
44
+
45
+    /** A command info object for this command. */
46
+    public static final CommandInfo INFO = new BaseCommandInfo("nick",
47
+            "nick <new nickname> - attempts to change your nickname to the one specified",
48
+            CommandType.TYPE_SERVER);
44 49
 
45 50
     /** {@inheritDoc} */
46 51
     @Override
@@ -55,30 +60,6 @@ public class Nick extends Command implements IntelligentCommand,
55 60
         server.getParser().getLocalClient().setNickname(args.getArguments()[0]);
56 61
     }
57 62
 
58
-    /** {@inheritDoc} */
59
-    @Override
60
-    public String getName() {
61
-        return "nick";
62
-    }
63
-
64
-    /** {@inheritDoc} */
65
-    @Override
66
-    public boolean showInHelp() {
67
-        return true;
68
-    }
69
-
70
-    /** {@inheritDoc} */
71
-    @Override
72
-    public CommandType getType() {
73
-        return CommandType.TYPE_SERVER;
74
-    }
75
-
76
-    /** {@inheritDoc} */
77
-    @Override
78
-    public String getHelp() {
79
-        return "nick <new nickname> - attempts to change your nickname to the one specified";
80
-    }
81
-
82 63
     /** {@inheritDoc} */
83 64
     @Override
84 65
     public AdditionalTabTargets getSuggestions(final int arg,

+ 7
- 26
src/com/dmdirc/commandparser/commands/server/Notice.java 查看文件

@@ -24,6 +24,7 @@ package com.dmdirc.commandparser.commands.server;
24 24
 
25 25
 import com.dmdirc.FrameContainer;
26 26
 import com.dmdirc.Server;
27
+import com.dmdirc.commandparser.BaseCommandInfo;
27 28
 import com.dmdirc.commandparser.CommandArguments;
28 29
 import com.dmdirc.commandparser.CommandInfo;
29 30
 import com.dmdirc.commandparser.CommandType;
@@ -39,8 +40,12 @@ import com.dmdirc.ui.input.TabCompletionType;
39 40
  * Allows the user to send notices.
40 41
  */
41 42
 @CommandOptions(allowOffline = false)
42
-public class Notice extends Command implements IntelligentCommand,
43
-        CommandInfo {
43
+public class Notice extends Command implements IntelligentCommand {
44
+
45
+    /** A command info object for this command. */
46
+    public static final CommandInfo INFO = new BaseCommandInfo("notice",
47
+            "notice <target> <message> - sends a notice",
48
+            CommandType.TYPE_SERVER);
44 49
 
45 50
     /** {@inheritDoc} */
46 51
     @Override
@@ -57,30 +62,6 @@ public class Notice extends Command implements IntelligentCommand,
57 62
         }
58 63
     }
59 64
 
60
-    /** {@inheritDoc} */
61
-    @Override
62
-    public String getName() {
63
-        return "notice";
64
-    }
65
-
66
-    /** {@inheritDoc} */
67
-    @Override
68
-    public boolean showInHelp() {
69
-        return true;
70
-    }
71
-
72
-    /** {@inheritDoc} */
73
-    @Override
74
-    public CommandType getType() {
75
-        return CommandType.TYPE_SERVER;
76
-    }
77
-
78
-    /** {@inheritDoc} */
79
-    @Override
80
-    public String getHelp() {
81
-        return "notice <target> <message> - sends a notice";
82
-    }
83
-
84 65
     /** {@inheritDoc} */
85 66
     @Override
86 67
     public AdditionalTabTargets getSuggestions(final int arg,

+ 7
- 25
src/com/dmdirc/commandparser/commands/server/OpenQuery.java 查看文件

@@ -25,6 +25,7 @@ package com.dmdirc.commandparser.commands.server;
25 25
 import com.dmdirc.FrameContainer;
26 26
 import com.dmdirc.Query;
27 27
 import com.dmdirc.Server;
28
+import com.dmdirc.commandparser.BaseCommandInfo;
28 29
 import com.dmdirc.commandparser.CommandArguments;
29 30
 import com.dmdirc.commandparser.CommandInfo;
30 31
 import com.dmdirc.commandparser.CommandManager;
@@ -43,7 +44,12 @@ import com.dmdirc.ui.messages.Styliser;
43 44
  * Allows the user to open a query dialog with another user.
44 45
  */
45 46
 public class OpenQuery extends Command implements IntelligentCommand,
46
-        WrappableCommand, CommandInfo {
47
+        WrappableCommand {
48
+
49
+    /** A command info object for this command. */
50
+    public static final CommandInfo INFO = new BaseCommandInfo("query",
51
+            "query <user> [message] - opens a query with the specified user",
52
+            CommandType.TYPE_SERVER);
47 53
 
48 54
     /** {@inheritDoc} */
49 55
     @Override
@@ -77,30 +83,6 @@ public class OpenQuery extends Command implements IntelligentCommand,
77 83
         }
78 84
     }
79 85
 
80
-    /** {@inheritDoc} */
81
-    @Override
82
-    public String getName() {
83
-        return "query";
84
-    }
85
-
86
-    /** {@inheritDoc} */
87
-    @Override
88
-    public boolean showInHelp() {
89
-        return true;
90
-    }
91
-
92
-    /** {@inheritDoc} */
93
-    @Override
94
-    public CommandType getType() {
95
-        return CommandType.TYPE_SERVER;
96
-    }
97
-
98
-    /** {@inheritDoc} */
99
-    @Override
100
-    public String getHelp() {
101
-        return "query <user> [message] - opens a query with the specified user";
102
-    }
103
-
104 86
     /** {@inheritDoc} */
105 87
     @Override
106 88
     public AdditionalTabTargets getSuggestions(final int arg,

+ 7
- 25
src/com/dmdirc/commandparser/commands/server/Raw.java 查看文件

@@ -24,6 +24,7 @@ package com.dmdirc.commandparser.commands.server;
24 24
 
25 25
 import com.dmdirc.FrameContainer;
26 26
 import com.dmdirc.Server;
27
+import com.dmdirc.commandparser.BaseCommandInfo;
27 28
 import com.dmdirc.commandparser.CommandArguments;
28 29
 import com.dmdirc.commandparser.CommandInfo;
29 30
 import com.dmdirc.commandparser.CommandType;
@@ -37,7 +38,12 @@ import com.dmdirc.commandparser.commands.context.ServerCommandContext;
37 38
  * irc server.
38 39
  */
39 40
 @CommandOptions(allowOffline=false)
40
-public class Raw extends Command implements CommandInfo {
41
+public class Raw extends Command {
42
+
43
+    /** A command info object for this command. */
44
+    public static final CommandInfo INFO = new BaseCommandInfo("raw",
45
+            "raw <text> - sends the specified text directly to the server",
46
+            CommandType.TYPE_SERVER);
41 47
 
42 48
     /** {@inheritDoc} */
43 49
     @Override
@@ -50,28 +56,4 @@ public class Raw extends Command implements CommandInfo {
50 56
         sendLine(origin, args.isSilent(), "rawCommand", line);
51 57
     }
52 58
 
53
-    /** {@inheritDoc} */
54
-    @Override
55
-    public String getName() {
56
-        return "raw";
57
-    }
58
-
59
-    /** {@inheritDoc} */
60
-    @Override
61
-    public boolean showInHelp() {
62
-        return true;
63
-    }
64
-
65
-    /** {@inheritDoc} */
66
-    @Override
67
-    public CommandType getType() {
68
-        return CommandType.TYPE_SERVER;
69
-    }
70
-
71
-    /** {@inheritDoc} */
72
-    @Override
73
-    public String getHelp() {
74
-        return "raw <text> - sends the specified text directly to the server";
75
-    }
76
-
77 59
 }

+ 7
- 26
src/com/dmdirc/commandparser/commands/server/Reconnect.java 查看文件

@@ -24,6 +24,7 @@ package com.dmdirc.commandparser.commands.server;
24 24
 
25 25
 import com.dmdirc.FrameContainer;
26 26
 import com.dmdirc.Server;
27
+import com.dmdirc.commandparser.BaseCommandInfo;
27 28
 import com.dmdirc.commandparser.CommandArguments;
28 29
 import com.dmdirc.commandparser.CommandInfo;
29 30
 import com.dmdirc.commandparser.CommandType;
@@ -34,7 +35,12 @@ import com.dmdirc.commandparser.commands.context.ServerCommandContext;
34 35
 /**
35 36
  * The reconnect command reconnects to the current server.
36 37
  */
37
-public class Reconnect extends Command implements CommandInfo {
38
+public class Reconnect extends Command {
39
+
40
+    /** A command info object for this command. */
41
+    public static final CommandInfo INFO = new BaseCommandInfo("reconnect",
42
+            "reconnect [reason] - reconnect to this server",
43
+            CommandType.TYPE_SERVER);
38 44
 
39 45
     /** {@inheritDoc} */
40 46
     @Override
@@ -52,29 +58,4 @@ public class Reconnect extends Command implements CommandInfo {
52 58
         server.reconnect(line);
53 59
     }
54 60
 
55
-
56
-    /** {@inheritDoc} */
57
-    @Override
58
-    public String getName() {
59
-        return "reconnect";
60
-    }
61
-
62
-    /** {@inheritDoc} */
63
-    @Override
64
-    public boolean showInHelp() {
65
-        return true;
66
-    }
67
-
68
-    /** {@inheritDoc} */
69
-    @Override
70
-    public CommandType getType() {
71
-        return CommandType.TYPE_SERVER;
72
-    }
73
-
74
-    /** {@inheritDoc} */
75
-    @Override
76
-    public String getHelp() {
77
-        return "reconnect [reason] - reconnect to this server";
78
-    }
79
-
80 61
 }

+ 7
- 26
src/com/dmdirc/commandparser/commands/server/ServerSettings.java 查看文件

@@ -24,6 +24,7 @@
24 24
 package com.dmdirc.commandparser.commands.server;
25 25
 
26 26
 import com.dmdirc.FrameContainer;
27
+import com.dmdirc.commandparser.BaseCommandInfo;
27 28
 import com.dmdirc.commandparser.CommandArguments;
28 29
 import com.dmdirc.commandparser.CommandInfo;
29 30
 import com.dmdirc.commandparser.CommandType;
@@ -40,8 +41,12 @@ import com.dmdirc.ui.input.AdditionalTabTargets;
40 41
  * @since 0.6.4
41 42
  */
42 43
 @CommandOptions(allowOffline=false)
43
-public class ServerSettings extends Command implements IntelligentCommand,
44
-        CommandInfo {
44
+public class ServerSettings extends Command implements IntelligentCommand {
45
+
46
+    /** A command info object for this command. */
47
+    public static final CommandInfo INFO = new BaseCommandInfo("serversettings",
48
+            "serversettings - opens the server settings window",
49
+            CommandType.TYPE_SERVER);
45 50
 
46 51
     /** {@inheritDoc} */
47 52
     @Override
@@ -51,30 +56,6 @@ public class ServerSettings extends Command implements IntelligentCommand,
51 56
                 ((ServerCommandContext) context).getServer());
52 57
     }
53 58
 
54
-    /** {@inheritDoc} */
55
-    @Override
56
-    public String getName() {
57
-        return "serversettings";
58
-    }
59
-
60
-    /** {@inheritDoc} */
61
-    @Override
62
-    public boolean showInHelp() {
63
-        return true;
64
-    }
65
-
66
-    /** {@inheritDoc} */
67
-    @Override
68
-    public String getHelp() {
69
-        return "serversettings - opens the server settings window";
70
-    }
71
-
72
-    /** {@inheritDoc} */
73
-    @Override
74
-    public CommandType getType() {
75
-        return CommandType.TYPE_SERVER;
76
-    }
77
-
78 59
     /** {@inheritDoc} */
79 60
     @Override
80 61
     public AdditionalTabTargets getSuggestions(final int arg,

+ 7
- 25
src/com/dmdirc/commandparser/commands/server/Umode.java 查看文件

@@ -25,6 +25,7 @@ package com.dmdirc.commandparser.commands.server;
25 25
 import com.dmdirc.FrameContainer;
26 26
 import com.dmdirc.Server;
27 27
 import com.dmdirc.ServerState;
28
+import com.dmdirc.commandparser.BaseCommandInfo;
28 29
 import com.dmdirc.commandparser.CommandArguments;
29 30
 import com.dmdirc.commandparser.CommandInfo;
30 31
 import com.dmdirc.commandparser.CommandType;
@@ -37,7 +38,12 @@ import com.dmdirc.commandparser.commands.context.ServerCommandContext;
37 38
  * Allows the user to change user modes.
38 39
  */
39 40
 @CommandOptions(allowOffline=false)
40
-public class Umode extends Command implements CommandInfo {
41
+public class Umode extends Command {
42
+
43
+    /** A command info object for this command. */
44
+    public static final CommandInfo INFO = new BaseCommandInfo("umode",
45
+            "umode [modes] - sets or displays your user modes",
46
+            CommandType.TYPE_SERVER);
41 47
 
42 48
     /** {@inheritDoc} */
43 49
     @Override
@@ -54,28 +60,4 @@ public class Umode extends Command implements CommandInfo {
54 60
                 + " " + args.getArgumentsAsString());
55 61
     }
56 62
 
57
-    /** {@inheritDoc} */
58
-    @Override
59
-    public String getName() {
60
-        return "umode";
61
-    }
62
-
63
-    /** {@inheritDoc} */
64
-    @Override
65
-    public boolean showInHelp() {
66
-        return true;
67
-    }
68
-
69
-    /** {@inheritDoc} */
70
-    @Override
71
-    public CommandType getType() {
72
-        return CommandType.TYPE_SERVER;
73
-    }
74
-
75
-    /** {@inheritDoc} */
76
-    @Override
77
-    public String getHelp() {
78
-        return "umode [modes] - sets or displays your user modes";
79
-    }
80
-
81 63
 }

+ 3
- 3
test/com/dmdirc/commandparser/commands/channel/BanTest.java 查看文件

@@ -49,7 +49,7 @@ public class BanTest {
49 49
         final FrameContainer tiw = mock(FrameContainer.class);
50 50
         final Channel channel = mock(Channel.class);
51 51
         command.execute(tiw, new CommandArguments("/ban"),
52
-                new ChannelCommandContext(null, command, channel));
52
+                new ChannelCommandContext(null, Ban.INFO, channel));
53 53
 
54 54
         verify(tiw).addLine(eq("commandUsage"), anyChar(), anyString(), anyString());
55 55
     }
@@ -69,7 +69,7 @@ public class BanTest {
69 69
         when(clientInfo.getHostname()).thenReturn("my.host.name");
70 70
 
71 71
         command.execute(container, new CommandArguments("/ban user"),
72
-                new ChannelCommandContext(null, command, channel));
72
+                new ChannelCommandContext(null, Ban.INFO, channel));
73 73
 
74 74
         verify(channelInfo).alterMode(true, 'b', "*!*@my.host.name");
75 75
         verify(channelInfo).flushModes();
@@ -85,7 +85,7 @@ public class BanTest {
85 85
         when(channel.getChannelInfo()).thenReturn(channelInfo);
86 86
 
87 87
         command.execute(container, new CommandArguments("/ban *!*@my.host.name"),
88
-                new ChannelCommandContext(null, command, channel));
88
+                new ChannelCommandContext(null, Ban.INFO, channel));
89 89
 
90 90
         verify(channelInfo).alterMode(true, 'b', "*!*@my.host.name");
91 91
         verify(channelInfo).flushModes();

+ 6
- 6
test/com/dmdirc/commandparser/commands/channel/KickReasonTest.java 查看文件

@@ -41,7 +41,7 @@ public class KickReasonTest {
41 41
     public static void setUpClass() throws Exception {
42 42
         IdentityManager.load();
43 43
     }
44
-    
44
+
45 45
     private final KickReason command = new KickReason();
46 46
 
47 47
     @Test
@@ -49,8 +49,8 @@ public class KickReasonTest {
49 49
         final FrameContainer tiw = mock(FrameContainer.class);
50 50
         final Channel channel = mock(Channel.class);
51 51
         command.execute(tiw, new CommandArguments("/kick"),
52
-                new ChannelCommandContext(null, command, channel));
53
-        
52
+                new ChannelCommandContext(null, KickReason.INFO, channel));
53
+
54 54
         verify(tiw).addLine(eq("commandUsage"), anyChar(), anyString(), anyString());
55 55
     }
56 56
 
@@ -64,7 +64,7 @@ public class KickReasonTest {
64 64
         when(channelInfo.getChannelClient(anyString())).thenReturn(null);
65 65
 
66 66
         command.execute(tiw, new CommandArguments("/kick user1"),
67
-                new ChannelCommandContext(null, command, channel));
67
+                new ChannelCommandContext(null, KickReason.INFO, channel));
68 68
 
69 69
         verify(tiw).addLine(eq("commandError"), matches(".*user1"));
70 70
     }
@@ -80,7 +80,7 @@ public class KickReasonTest {
80 80
         when(channelInfo.getChannelClient("user1")).thenReturn(cci);
81 81
 
82 82
         command.execute(tiw, new CommandArguments("/kick user1 reason here"),
83
-                new ChannelCommandContext(null, command, channel));
83
+                new ChannelCommandContext(null, KickReason.INFO, channel));
84 84
 
85 85
         verify(cci).kick("reason here");
86 86
     }
@@ -99,7 +99,7 @@ public class KickReasonTest {
99 99
         when(manager.getOption("general", "kickmessage")).thenReturn("reason here");
100 100
 
101 101
         command.execute(tiw, new CommandArguments("/kick user1"),
102
-                new ChannelCommandContext(null, command, channel));
102
+                new ChannelCommandContext(null, KickReason.INFO, channel));
103 103
 
104 104
         verify(cci).kick("reason here");
105 105
     }

+ 5
- 5
test/com/dmdirc/commandparser/commands/channel/ModeTest.java 查看文件

@@ -53,7 +53,7 @@ public class ModeTest {
53 53
     @Before
54 54
     public void setUp() throws InvalidIdentityFileException {
55 55
         IdentityManager.load();
56
-        
56
+
57 57
         parser = mock(IRCParser.class);
58 58
         server = mock(Server.class);
59 59
         channel = mock(Channel.class);
@@ -69,9 +69,9 @@ public class ModeTest {
69 69
     @Test
70 70
     public void testWithoutArgs() {
71 71
         final FrameContainer origin = mock(FrameContainer.class);
72
-        
72
+
73 73
         command.execute(origin, new CommandArguments("/mode"),
74
-                new ChannelCommandContext(null, command, channel));
74
+                new ChannelCommandContext(null, Mode.INFO, channel));
75 75
 
76 76
         verify(origin).addLine("channelModeDiscovered", "my mode string!", channelinfo);
77 77
     }
@@ -81,7 +81,7 @@ public class ModeTest {
81 81
         final FrameContainer origin = mock(FrameContainer.class);
82 82
 
83 83
         command.execute(origin, new CommandArguments("/mode +hello -bye"),
84
-                new ChannelCommandContext(null, command, channel));
84
+                new ChannelCommandContext(null, Mode.INFO, channel));
85 85
 
86 86
         verify(parser).sendRawMessage("MODE #chan +hello -bye");
87 87
     }
@@ -91,7 +91,7 @@ public class ModeTest {
91 91
         final FrameContainer origin = mock(FrameContainer.class);
92 92
 
93 93
         command.execute(origin, new CommandArguments("/mode +hello -bye"),
94
-                new ChannelCommandContext(null, command, channel));
94
+                new ChannelCommandContext(null, Mode.INFO, channel));
95 95
 
96 96
         verify(parser).sendRawMessage("MODE #chan +hello -bye");
97 97
     }

+ 2
- 2
test/com/dmdirc/commandparser/commands/channel/NamesTest.java 查看文件

@@ -52,7 +52,7 @@ public class NamesTest {
52 52
     @Before
53 53
     public void setUp() throws InvalidIdentityFileException {
54 54
         IdentityManager.load();
55
-        
55
+
56 56
         parser = mock(IRCParser.class);
57 57
         server = mock(Server.class);
58 58
         channel = mock(Channel.class);
@@ -67,7 +67,7 @@ public class NamesTest {
67 67
     @Test
68 68
     public void testNormal() {
69 69
         command.execute(null, new CommandArguments("/names"),
70
-                new ChannelCommandContext(null, command, channel));
70
+                new ChannelCommandContext(null, Names.INFO, channel));
71 71
 
72 72
         verify(parser).sendRawMessage("NAMES #chan");
73 73
     }

+ 4
- 4
test/com/dmdirc/commandparser/commands/channel/PartTest.java 查看文件

@@ -50,11 +50,11 @@ public class PartTest {
50 50
     @Before
51 51
     public void setUp() throws InvalidIdentityFileException {
52 52
         IdentityManager.load();
53
-        
53
+
54 54
         channel = mock(Channel.class);
55 55
         origin = mock(FrameContainer.class);
56 56
         manager = mock(ConfigManager.class);
57
-        
57
+
58 58
         when(origin.getConfigManager()).thenReturn(manager);
59 59
         when(manager.getOption("general", "partmessage")).thenReturn("config part message");
60 60
     }
@@ -62,7 +62,7 @@ public class PartTest {
62 62
     @Test
63 63
     public void testWithoutArgs() {
64 64
         command.execute(origin, new CommandArguments("/part"),
65
-                new ChannelCommandContext(null, command, channel));
65
+                new ChannelCommandContext(null, Part.INFO, channel));
66 66
 
67 67
         verify(channel).part("config part message");
68 68
         verify(channel).close();
@@ -71,7 +71,7 @@ public class PartTest {
71 71
     @Test
72 72
     public void testWithArgs() {
73 73
         command.execute(origin, new CommandArguments("/part custom part"),
74
-                new ChannelCommandContext(null, command, channel));
74
+                new ChannelCommandContext(null, Part.INFO, channel));
75 75
 
76 76
         verify(channel).part("custom part");
77 77
         verify(channel).close();

+ 11
- 11
test/com/dmdirc/commandparser/commands/channel/SetNickColourTest.java 查看文件

@@ -45,34 +45,34 @@ public class SetNickColourTest {
45 45
     public void setUp() {
46 46
         channel = mock(Channel.class);
47 47
     }
48
-    
48
+
49 49
     private final SetNickColour command = new SetNickColour();
50 50
 
51 51
     @Test
52 52
     public void testUsageNoArgs() {
53 53
         final FrameContainer tiw = mock(FrameContainer.class);
54 54
         command.execute(tiw, new CommandArguments("/foo"),
55
-                new ChannelCommandContext(null, command, channel));
56
-        
55
+                new ChannelCommandContext(null, SetNickColour.INFO, channel));
56
+
57 57
         verify(tiw).addLine(eq("commandUsage"), anyChar(), anyString(), anyString());
58 58
     }
59
-    
59
+
60 60
     @Test
61 61
     public void testUsageNicklist() {
62 62
         final FrameContainer tiw = mock(FrameContainer.class);
63 63
         command.execute(tiw, new CommandArguments("/foo --nicklist"),
64
-                new ChannelCommandContext(null, command, channel));
65
-        
64
+                new ChannelCommandContext(null, SetNickColour.INFO, channel));
65
+
66 66
         verify(tiw).addLine(eq("commandUsage"), anyChar(), anyString(), anyString());
67
-    }    
68
-    
67
+    }
68
+
69 69
     @Test
70 70
     public void testUsageText() {
71 71
         final FrameContainer tiw = mock(FrameContainer.class);
72 72
         command.execute(tiw, new CommandArguments("/foo --text"),
73
-                new ChannelCommandContext(null, command, channel));
74
-        
73
+                new ChannelCommandContext(null, SetNickColour.INFO, channel));
74
+
75 75
         verify(tiw).addLine(eq("commandUsage"), anyChar(), anyString(), anyString());
76
-    }       
76
+    }
77 77
 
78 78
 }

+ 5
- 5
test/com/dmdirc/commandparser/commands/chat/MeTest.java 查看文件

@@ -33,7 +33,7 @@ import org.junit.Test;
33 33
 import static org.mockito.Mockito.*;
34 34
 
35 35
 public class MeTest {
36
- 
36
+
37 37
     private final Me command = new Me();
38 38
     private MessageTarget mtt;
39 39
 
@@ -51,15 +51,15 @@ public class MeTest {
51 51
     public void testUsage() {
52 52
         final FrameContainer tiw = mock(FrameContainer.class);
53 53
         command.execute(tiw, new CommandArguments("/foo"),
54
-                new ChatCommandContext(null, command, mtt));
55
-        
54
+                new ChatCommandContext(null, Me.INFO, mtt));
55
+
56 56
         verify(tiw).addLine(eq("commandUsage"), anyChar(), anyString(), anyString());
57 57
     }
58
-    
58
+
59 59
     @Test
60 60
     public void testSend() {
61 61
         command.execute(null, new CommandArguments("/foo hello meep moop"),
62
-                new ChatCommandContext(null, command, mtt));
62
+                new ChatCommandContext(null, Me.INFO, mtt));
63 63
 
64 64
         verify(mtt).sendAction("hello meep moop");
65 65
     }

+ 8
- 8
test/com/dmdirc/commandparser/commands/global/AliasCommandTest.java 查看文件

@@ -33,7 +33,7 @@ import static org.mockito.Mockito.*;
33 33
 public class AliasCommandTest {
34 34
 
35 35
     private final AliasCommand command = new AliasCommand();
36
-    
36
+
37 37
     @BeforeClass
38 38
     public static void setUpClass() throws Exception {
39 39
         IdentityManager.load();
@@ -44,19 +44,19 @@ public class AliasCommandTest {
44 44
         final FrameContainer tiw = mock(FrameContainer.class);
45 45
 
46 46
         command.execute(tiw, new CommandArguments("/foo"),
47
-                new CommandContext(null, command));
48
-        
47
+                new CommandContext(null, AliasCommand.INFO));
48
+
49 49
         verify(tiw).addLine(eq("commandUsage"), anyChar(), anyString(), anyString());
50 50
     }
51
-    
51
+
52 52
     @Test
53 53
     public void testUsageOneArg() {
54 54
         final FrameContainer tiw = mock(FrameContainer.class);
55
-        
55
+
56 56
         command.execute(tiw, new CommandArguments("/foo --remove"),
57
-                new CommandContext(null, command));
58
-        
57
+                new CommandContext(null, AliasCommand.INFO));
58
+
59 59
         verify(tiw).addLine(eq("commandUsage"), anyChar(), anyString(), anyString());
60
-    }    
60
+    }
61 61
 
62 62
 }

+ 2
- 2
test/com/dmdirc/commandparser/commands/global/IfpluginTest.java 查看文件

@@ -43,7 +43,7 @@ public class IfpluginTest {
43 43
     public void testUsageNoArgs() {
44 44
         final FrameContainer tiw = mock(FrameContainer.class);
45 45
         command.execute(tiw, new CommandArguments("/foo"),
46
-                new CommandContext(null, command));
46
+                new CommandContext(null, Ifplugin.INFO));
47 47
 
48 48
         verify(tiw).addLine(eq("commandUsage"), anyChar(), anyString(), anyString());
49 49
     }
@@ -52,7 +52,7 @@ public class IfpluginTest {
52 52
     public void testUsageOneArg() {
53 53
         final FrameContainer tiw = mock(FrameContainer.class);
54 54
         command.execute(tiw, new CommandArguments("/foo bar"),
55
-                new CommandContext(null, command));
55
+                new CommandContext(null, Ifplugin.INFO));
56 56
 
57 57
         verify(tiw).addLine(eq("commandUsage"), anyChar(), anyString(), anyString());
58 58
     }

+ 11
- 11
test/com/dmdirc/commandparser/commands/global/NewServerTest.java 查看文件

@@ -43,35 +43,35 @@ public class NewServerTest {
43 43
     public void testUsageNoArgs() {
44 44
         final FrameContainer tiw = mock(FrameContainer.class);
45 45
         command.execute(tiw, new CommandArguments("/foo"),
46
-                new CommandContext(null, command));
47
-        
46
+                new CommandContext(null, NewServer.INFO));
47
+
48 48
         verify(tiw).addLine(eq("commandUsage"), anyChar(), anyString(), anyString());
49 49
     }
50
-    
50
+
51 51
     @Test
52 52
     public void testInvalidPort() {
53 53
         final FrameContainer tiw = mock(FrameContainer.class);
54 54
         command.execute(tiw, new CommandArguments("/foo foo:abc"),
55
-                new CommandContext(null, command));
56
-        
55
+                new CommandContext(null, NewServer.INFO));
56
+
57 57
         verify(tiw).addLine(eq("commandError"), anyString());
58 58
     }
59
-    
59
+
60 60
     @Test
61 61
     public void testOutOfRangePort1() {
62 62
         final FrameContainer tiw = mock(FrameContainer.class);
63 63
         command.execute(tiw, new CommandArguments("/foo foo:0"),
64
-                new CommandContext(null, command));
65
-        
64
+                new CommandContext(null, NewServer.INFO));
65
+
66 66
         verify(tiw).addLine(eq("commandError"), anyString());
67 67
     }
68
-    
68
+
69 69
     @Test
70 70
     public void testOutOfRangePort2() {
71 71
         final FrameContainer tiw = mock(FrameContainer.class);
72 72
         command.execute(tiw, new CommandArguments("/foo foo:65537"),
73
-                new CommandContext(null, command));
74
-        
73
+                new CommandContext(null, NewServer.INFO));
74
+
75 75
         verify(tiw).addLine(eq("commandError"), anyString());
76 76
     }
77 77
 

+ 16
- 16
test/com/dmdirc/commandparser/commands/server/ChangeServerTest.java 查看文件

@@ -41,7 +41,7 @@ public class ChangeServerTest {
41 41
     private FrameContainer tiw;
42 42
     private Identity profile;
43 43
     private Server server;
44
-    
44
+
45 45
     @BeforeClass
46 46
     public static void setUpClass() throws Exception {
47 47
         IdentityManager.load();
@@ -58,39 +58,39 @@ public class ChangeServerTest {
58 58
     @Test
59 59
     public void testUsageNoArgs() {
60 60
         command.execute(tiw, new CommandArguments("/server"),
61
-                new ServerCommandContext(null, command, server));
62
-        
61
+                new ServerCommandContext(null, ChangeServer.INFO, server));
62
+
63 63
         verify(tiw).addLine(eq("commandUsage"), anyChar(), anyString(), anyString());
64 64
     }
65
-    
65
+
66 66
     @Test
67 67
     public void testInvalidPort() {
68 68
         command.execute(tiw, new CommandArguments("/server foo:abc"),
69
-                new ServerCommandContext(null, command, server));
70
-        
69
+                new ServerCommandContext(null, ChangeServer.INFO, server));
70
+
71 71
         verify(tiw).addLine(eq("commandError"), anyString());
72 72
     }
73
-    
73
+
74 74
     @Test
75 75
     public void testOutOfRangePort1() {
76 76
         command.execute(tiw, new CommandArguments("/server foo:0"),
77
-                new ServerCommandContext(null, command, server));
78
-        
77
+                new ServerCommandContext(null, ChangeServer.INFO, server));
78
+
79 79
         verify(tiw).addLine(eq("commandError"), anyString());
80 80
     }
81
-    
81
+
82 82
     @Test
83 83
     public void testOutOfRangePort2() {
84 84
         command.execute(tiw, new CommandArguments("/server foo:65537"),
85
-                new ServerCommandContext(null, command, server));
86
-        
85
+                new ServerCommandContext(null, ChangeServer.INFO, server));
86
+
87 87
         verify(tiw).addLine(eq("commandError"), anyString());
88 88
     }
89 89
 
90 90
     @Test
91 91
     public void testExecuteBasic() throws URISyntaxException {
92 92
         command.execute(tiw, new CommandArguments("/server foo:1234"),
93
-                new ServerCommandContext(null, command, server));
93
+                new ServerCommandContext(null, ChangeServer.INFO, server));
94 94
 
95 95
         verify(server).connect(eq(new URI("irc://foo:1234")), same(profile));
96 96
     }
@@ -98,7 +98,7 @@ public class ChangeServerTest {
98 98
     @Test
99 99
     public void testExecuteNoPort() throws URISyntaxException {
100 100
         command.execute(tiw, new CommandArguments("/server foo"),
101
-                new ServerCommandContext(null, command, server));
101
+                new ServerCommandContext(null, ChangeServer.INFO, server));
102 102
 
103 103
         verify(server).connect(eq(new URI("irc://foo:6667")), same(profile));
104 104
     }
@@ -106,7 +106,7 @@ public class ChangeServerTest {
106 106
     @Test
107 107
     public void testDeprecatedSSL() throws URISyntaxException {
108 108
         command.execute(tiw, new CommandArguments("/server --ssl foo"),
109
-                new ServerCommandContext(null, command, server));
109
+                new ServerCommandContext(null, ChangeServer.INFO, server));
110 110
 
111 111
         verify(server).connect(eq(new URI("ircs://foo:6667")), same(profile));
112 112
     }
@@ -114,7 +114,7 @@ public class ChangeServerTest {
114 114
     @Test
115 115
     public void testExecuteComplex() throws URISyntaxException {
116 116
         command.execute(tiw, new CommandArguments("/server foo:+1234 password"),
117
-                new ServerCommandContext(null, command, server));
117
+                new ServerCommandContext(null, ChangeServer.INFO, server));
118 118
 
119 119
         verify(server).connect(eq(new URI("ircs://password@foo:1234")), same(profile));
120 120
     }

Loading…
取消
儲存