Ver código fonte

Commands no longer have arities

git-svn-id: http://svn.dmdirc.com/trunk@2703 00569f92-eb28-0410-84fd-f71c24880f
tags/0.5.5
Chris Smith 16 anos atrás
pai
commit
e5e13a12df
56 arquivos alterados com 243 adições e 899 exclusões
  1. 0
    14
      src/com/dmdirc/addons/audio/AudioCommand.java
  2. 5
    10
      src/com/dmdirc/addons/dcop/DcopCommand.java
  3. 5
    10
      src/com/dmdirc/addons/dns/DNSCommand.java
  4. 0
    14
      src/com/dmdirc/addons/logging/LoggingCommand.java
  5. 0
    10
      src/com/dmdirc/addons/nowplaying/NowPlayingCommand.java
  6. 4
    10
      src/com/dmdirc/addons/osdplugin/OsdCommand.java
  7. 0
    10
      src/com/dmdirc/addons/redirectplugin/RedirectCommand.java
  8. 4
    10
      src/com/dmdirc/addons/systray/PopupCommand.java
  9. 0
    10
      src/com/dmdirc/addons/timeplugin/TimerCommand.java
  10. 1
    27
      src/com/dmdirc/commandparser/CommandInfo.java
  11. 15
    18
      src/com/dmdirc/commandparser/CommandManager.java
  12. 1
    1
      src/com/dmdirc/commandparser/commands/Command.java
  13. 4
    10
      src/com/dmdirc/commandparser/commands/channel/Ban.java
  14. 0
    10
      src/com/dmdirc/commandparser/commands/channel/ChannelSettings.java
  15. 0
    10
      src/com/dmdirc/commandparser/commands/channel/Cycle.java
  16. 8
    21
      src/com/dmdirc/commandparser/commands/channel/KickReason.java
  17. 8
    21
      src/com/dmdirc/commandparser/commands/channel/Mode.java
  18. 9
    22
      src/com/dmdirc/commandparser/commands/channel/Part.java
  19. 0
    10
      src/com/dmdirc/commandparser/commands/channel/SetNickColour.java
  20. 0
    12
      src/com/dmdirc/commandparser/commands/channel/SetTopic.java
  21. 9
    22
      src/com/dmdirc/commandparser/commands/channel/ShowTopic.java
  22. 12
    14
      src/com/dmdirc/commandparser/commands/chat/Me.java
  23. 0
    76
      src/com/dmdirc/commandparser/commands/chat/MeEmpty.java
  24. 0
    10
      src/com/dmdirc/commandparser/commands/global/Active.java
  25. 7
    13
      src/com/dmdirc/commandparser/commands/global/AllServers.java
  26. 9
    19
      src/com/dmdirc/commandparser/commands/global/Clear.java
  27. 0
    12
      src/com/dmdirc/commandparser/commands/global/Debug.java
  28. 8
    23
      src/com/dmdirc/commandparser/commands/global/Echo.java
  29. 5
    11
      src/com/dmdirc/commandparser/commands/global/Exit.java
  30. 0
    10
      src/com/dmdirc/commandparser/commands/global/Help.java
  31. 14
    17
      src/com/dmdirc/commandparser/commands/global/Ifplugin.java
  32. 6
    11
      src/com/dmdirc/commandparser/commands/global/LoadPlugin.java
  33. 0
    10
      src/com/dmdirc/commandparser/commands/global/NewServer.java
  34. 13
    20
      src/com/dmdirc/commandparser/commands/global/Notify.java
  35. 0
    12
      src/com/dmdirc/commandparser/commands/global/OpenWindow.java
  36. 0
    10
      src/com/dmdirc/commandparser/commands/global/ReloadActions.java
  37. 0
    12
      src/com/dmdirc/commandparser/commands/global/ReloadIdentities.java
  38. 16
    15
      src/com/dmdirc/commandparser/commands/global/ReloadPlugin.java
  39. 0
    10
      src/com/dmdirc/commandparser/commands/global/SaveConfig.java
  40. 0
    12
      src/com/dmdirc/commandparser/commands/global/Set.java
  41. 10
    21
      src/com/dmdirc/commandparser/commands/server/AllChannels.java
  42. 8
    20
      src/com/dmdirc/commandparser/commands/server/Away.java
  43. 0
    10
      src/com/dmdirc/commandparser/commands/server/Back.java
  44. 7
    14
      src/com/dmdirc/commandparser/commands/server/ChangeServer.java
  45. 0
    10
      src/com/dmdirc/commandparser/commands/server/Ctcp.java
  46. 0
    10
      src/com/dmdirc/commandparser/commands/server/Disconnect.java
  47. 7
    13
      src/com/dmdirc/commandparser/commands/server/Ignore.java
  48. 8
    20
      src/com/dmdirc/commandparser/commands/server/Message.java
  49. 0
    85
      src/com/dmdirc/commandparser/commands/server/Motd.java
  50. 5
    10
      src/com/dmdirc/commandparser/commands/server/Nick.java
  51. 8
    20
      src/com/dmdirc/commandparser/commands/server/Notice.java
  52. 7
    13
      src/com/dmdirc/commandparser/commands/server/Query.java
  53. 0
    10
      src/com/dmdirc/commandparser/commands/server/Raw.java
  54. 7
    13
      src/com/dmdirc/commandparser/commands/server/RawServerCommand.java
  55. 8
    20
      src/com/dmdirc/commandparser/commands/server/Reconnect.java
  56. 5
    11
      src/com/dmdirc/commandparser/parsers/CommandParser.java

+ 0
- 14
src/com/dmdirc/addons/audio/AudioCommand.java Ver arquivo

@@ -80,20 +80,6 @@ public final class AudioCommand extends GlobalCommand {
80 80
 	 */
81 81
 	public boolean showInHelp() { return true; }
82 82
 	
83
-	/**
84
-	 * Indicates whether this command is polyadic or not.
85
-	 *
86
-	 * @return True iff this command is polyadic, false otherwise
87
-	 */
88
-	public boolean isPolyadic() { return true; }
89
-	
90
-	/**
91
-	 * Returns the arity of this command.
92
-	 *
93
-	 * @return This command's arity
94
-	 */
95
-	public int getArity() { return 0; }
96
-	
97 83
 	/**
98 84
 	 * Returns a string representing the help message for this command.
99 85
 	 *

+ 5
- 10
src/com/dmdirc/addons/dcop/DcopCommand.java Ver arquivo

@@ -53,6 +53,11 @@ public final class DcopCommand extends ServerCommand {
53 53
      */
54 54
     public void execute(final InputWindow origin, final Server server,
55 55
             final boolean isSilent, final String... args) {
56
+        if (args.length != 3) {
57
+            showUsage(origin, isSilent, "dcop", "<app> <object> <function>");
58
+            return;
59
+        }
60
+        
56 61
         final List<String> res = DcopPlugin.getDcopResult("dcop " + implodeArgs(args));
57 62
         for (String line : res) {
58 63
             sendLine(origin, isSilent, FORMAT_OUTPUT, line);
@@ -70,16 +75,6 @@ public final class DcopCommand extends ServerCommand {
70 75
         return true;
71 76
     }
72 77
     
73
-    /** {@inheritDoc}. */
74
-    public boolean isPolyadic() {
75
-        return false;
76
-    }
77
-    
78
-    /** {@inheritDoc}. */
79
-    public int getArity() {
80
-        return 3;
81
-    }
82
-    
83 78
     /** {@inheritDoc}. */
84 79
     public String getHelp() {
85 80
         return "dcop <app> <object> <function> - retrieves information from a DCOP aplication";

+ 5
- 10
src/com/dmdirc/addons/dns/DNSCommand.java Ver arquivo

@@ -44,6 +44,11 @@ public final class DNSCommand extends GlobalCommand {
44 44
     /** {@inheritDoc} */
45 45
     public void execute(final InputWindow origin, final boolean isSilent,
46 46
             final String... args) {
47
+        if (args.length == 0) {
48
+            showUsage(origin, isSilent, "dns", "<IP|hostname>");
49
+            return;
50
+        }
51
+        
47 52
         sendLine(origin, isSilent, FORMAT_OUTPUT, "Resolving: " + args[0]);
48 53
         new Timer("DNS Command Timer").schedule(new TimerTask() {
49 54
             public void run() {
@@ -66,16 +71,6 @@ public final class DNSCommand extends GlobalCommand {
66 71
         return true;
67 72
     }
68 73
     
69
-    /** {@inheritDoc} */
70
-    public boolean isPolyadic() {
71
-        return false;
72
-    }
73
-    
74
-    /** {@inheritDoc} */
75
-    public int getArity() {
76
-        return 1;
77
-    }
78
-    
79 74
     /** {@inheritDoc} */
80 75
     public String getHelp() {
81 76
         return "dns <IP|hostname> - Performs DNS lookup of the specified ip/hostname/nickname";

+ 0
- 14
src/com/dmdirc/addons/logging/LoggingCommand.java Ver arquivo

@@ -132,20 +132,6 @@ public final class LoggingCommand extends ServerCommand implements IntelligentCo
132 132
 	 */
133 133
 	public boolean showInHelp() { return true; }
134 134
 	
135
-	/**
136
-	 * Indicates whether this command is polyadic or not.
137
-	 *
138
-	 * @return True iff this command is polyadic, false otherwise
139
-	 */
140
-	public boolean isPolyadic() { return true; }
141
-	
142
-	/**
143
-	 * Returns the arity of this command.
144
-	 *
145
-	 * @return This command's arity
146
-	 */
147
-	public int getArity() { return 0; }
148
-	
149 135
 	/**
150 136
 	 * Returns a string representing the help message for this command.
151 137
 	 *

+ 0
- 10
src/com/dmdirc/addons/nowplaying/NowPlayingCommand.java Ver arquivo

@@ -148,16 +148,6 @@ public final class NowPlayingCommand extends ChatCommand implements IntelligentC
148 148
         return true;
149 149
     }
150 150
     
151
-    /** {@inheritDoc}. */
152
-    public boolean isPolyadic() {
153
-        return true;
154
-    }
155
-    
156
-    /** {@inheritDoc}. */
157
-    public int getArity() {
158
-        return 0;
159
-    }
160
-    
161 151
     /** {@inheritDoc}. */
162 152
     public String getHelp() {
163 153
         return "nowplaying [--sources|--source <source>] - tells the channel the song you're currently playing";

+ 4
- 10
src/com/dmdirc/addons/osdplugin/OsdCommand.java Ver arquivo

@@ -42,32 +42,26 @@ public final class OsdCommand extends GlobalCommand {
42 42
     }
43 43
     
44 44
     /** {@inheritDoc} */
45
+    @Override
45 46
     public void execute(final InputWindow origin, final boolean isSilent,
46 47
             final String... args) {
47 48
         new OsdWindow(implodeArgs(args), false);
48 49
     }
49 50
     
50 51
     /** {@inheritDoc}. */
52
+    @Override
51 53
     public String getName() {
52 54
         return "osd";
53 55
     }
54 56
     
55 57
     /** {@inheritDoc}. */
58
+    @Override
56 59
     public boolean showInHelp() {
57 60
         return true;
58 61
     }
59 62
     
60 63
     /** {@inheritDoc}. */
61
-    public boolean isPolyadic() {
62
-        return true;
63
-    }
64
-    
65
-    /** {@inheritDoc}. */
66
-    public int getArity() {
67
-        return 0;
68
-    }
69
-    
70
-    /** {@inheritDoc}. */
64
+    @Override
71 65
     public String getHelp() {
72 66
         return "osd <message> - show the specified message in an OSD window";
73 67
     }

+ 0
- 10
src/com/dmdirc/addons/redirectplugin/RedirectCommand.java Ver arquivo

@@ -55,16 +55,6 @@ public class RedirectCommand extends ChatCommand {
55 55
         return true;
56 56
     }
57 57
     
58
-    /** {@inheritDoc} */
59
-    public boolean isPolyadic() {
60
-        return true;
61
-    }
62
-    
63
-    /** {@inheritDoc} */
64
-    public int getArity() {
65
-        return 0;
66
-    }
67
-    
68 58
     /** {@inheritDoc} */
69 59
     public String getHelp() {
70 60
         return "redirect <command> - sends the output of the command to a channel or query window";

+ 4
- 10
src/com/dmdirc/addons/systray/PopupCommand.java Ver arquivo

@@ -50,32 +50,26 @@ public final class PopupCommand extends ServerCommand {
50 50
     }
51 51
 
52 52
     /** {@inheritDoc} */
53
+    @Override
53 54
     public void execute(final InputWindow origin, final Server server,
54 55
             final boolean isSilent, final String ... args) {
55 56
         parent.notify("DMDirc", implodeArgs(args));
56 57
     }
57 58
 
58 59
     /** {@inheritDoc} */
60
+    @Override
59 61
     public String getName() {
60 62
         return "popup";
61 63
     }
62 64
 
63 65
     /** {@inheritDoc} */
66
+    @Override
64 67
     public boolean showInHelp() {
65 68
         return true;
66 69
     }
67 70
 
68 71
     /** {@inheritDoc} */
69
-    public boolean isPolyadic() {
70
-        return true;
71
-    }
72
-
73
-    /** {@inheritDoc} */
74
-    public int getArity() {
75
-        return 0;
76
-    }
77
-
78
-    /** {@inheritDoc} */
72
+    @Override
79 73
     public String getHelp() {
80 74
         return "popup <message> - shows the message as a system tray popup";
81 75
     }

+ 0
- 10
src/com/dmdirc/addons/timeplugin/TimerCommand.java Ver arquivo

@@ -82,16 +82,6 @@ public final class TimerCommand extends GlobalCommand {
82 82
         return true;
83 83
     }
84 84
     
85
-    /** {@inheritDoc} */
86
-    public boolean isPolyadic() {
87
-        return true;
88
-    }
89
-    
90
-    /** {@inheritDoc} */
91
-    public int getArity() {
92
-        return 0;
93
-    }
94
-    
95 85
     /** {@inheritDoc} */
96 86
     public String getHelp() {
97 87
         return "timer <repetitions> <interval> <command> - schedules a command to be executed after a certain time";

+ 1
- 27
src/com/dmdirc/commandparser/CommandInfo.java Ver arquivo

@@ -27,21 +27,7 @@ package com.dmdirc.commandparser;
27 27
  * @author chris
28 28
  */
29 29
 public abstract class CommandInfo {
30
-    
31
-    /**
32
-     * Returns the signature of this command. For polyadic commands, the signature
33
-     * is simply the name. For other commands, the signature is a concatenation of
34
-     * the name, a literal "/", and the arity.
35
-     * @return The signature of this command
36
-     */
37
-    public final String getSignature() {
38
-        if (isPolyadic()) {
39
-            return getName();
40
-        } else {
41
-            return getName() + "/" + getArity();
42
-        }
43
-    }
44
-        
30
+          
45 31
     /**
46 32
      * Returns this command's name.
47 33
      * @return The name of this command
@@ -54,18 +40,6 @@ public abstract class CommandInfo {
54 40
      */
55 41
     public abstract boolean showInHelp();
56 42
     
57
-    /**
58
-     * Indicates whether this command is polyadic or not.
59
-     * @return True iff this command is polyadic, false otherwise
60
-     */
61
-    public abstract boolean isPolyadic();
62
-    
63
-    /**
64
-     * Returns the arity of this command.
65
-     * @return This command's arity
66
-     */
67
-    public abstract int getArity();
68
-    
69 43
     /**
70 44
      * Returns a string representing the help message for this command.
71 45
      * @return the help message for this command

+ 15
- 18
src/com/dmdirc/commandparser/CommandManager.java Ver arquivo

@@ -253,7 +253,6 @@ public final class CommandManager {
253 253
     public static void initCommands() {
254 254
         // Chat commands
255 255
         new Me();
256
-        new MeEmpty();
257 256
         
258 257
         // Channel commands
259 258
         new Ban();
@@ -331,11 +330,11 @@ public final class CommandManager {
331 330
      * @param parser The parser to load commands into
332 331
      */
333 332
     public static void loadChannelCommands(final CommandParser parser) {
334
-        for (Command com : getCommands(CommandType.TYPE_CHANNEL, null, null)) {
333
+        for (Command com : getCommands(CommandType.TYPE_CHANNEL, null)) {
335 334
             parser.registerCommand(com);
336 335
         }
337 336
         
338
-        for (Command com : getCommands(CommandType.TYPE_CHAT, null, null)) {
337
+        for (Command com : getCommands(CommandType.TYPE_CHAT, null)) {
339 338
             parser.registerCommand(com);
340 339
         }
341 340
         
@@ -348,7 +347,7 @@ public final class CommandManager {
348 347
      * @param parser The parser to load commands into
349 348
      */
350 349
     public static void loadServerCommands(final CommandParser parser) {
351
-        for (Command command : getCommands(CommandType.TYPE_SERVER, null, null)) {
350
+        for (Command command : getCommands(CommandType.TYPE_SERVER, null)) {
352 351
             parser.registerCommand(command);
353 352
         }
354 353
         
@@ -361,7 +360,7 @@ public final class CommandManager {
361 360
      * @param parser The parser to load commands into
362 361
      */
363 362
     public static void loadGlobalCommands(final CommandParser parser) {
364
-        for (Command com : getCommands(CommandType.TYPE_GLOBAL, null, null)) {
363
+        for (Command com : getCommands(CommandType.TYPE_GLOBAL, null)) {
365 364
             parser.registerCommand(com);
366 365
         }
367 366
         
@@ -374,11 +373,11 @@ public final class CommandManager {
374 373
      * @param parser The parser to load commands into
375 374
      */
376 375
     public static void loadQueryCommands(final CommandParser parser) {
377
-        for (Command com : getCommands(CommandType.TYPE_QUERY, null, null)) {
376
+        for (Command com : getCommands(CommandType.TYPE_QUERY, null)) {
378 377
             parser.registerCommand(com);
379 378
         }
380 379
         
381
-        for (Command com : getCommands(CommandType.TYPE_CHAT, null, null)) {
380
+        for (Command com : getCommands(CommandType.TYPE_CHAT, null)) {
382 381
             parser.registerCommand(com);
383 382
         }
384 383
         
@@ -393,12 +392,11 @@ public final class CommandManager {
393 392
      * @return A command with a matching signature, or null if none were found
394 393
      */
395 394
     public static Command getCommand(final String name) {
396
-        return getCommand(null, name, null);
395
+        return getCommand(null, name);
397 396
     }
398 397
     
399
-    public static Command getCommand(final CommandType type, final String name,
400
-            final String signature) {
401
-        final List<Command> res = getCommands(type, name, signature);
398
+    public static Command getCommand(final CommandType type, final String name) {
399
+        final List<Command> res = getCommands(type, name);
402 400
         
403 401
         return res.isEmpty() ? null : res.get(0);
404 402
     }    
@@ -410,14 +408,14 @@ public final class CommandManager {
410 408
      * @return True iff the command is a channel command, false otherwise
411 409
      */
412 410
     public static boolean isChannelCommand(final String command) {
413
-        return getCommand(CommandType.TYPE_CHANNEL, command, null) != null
414
-                || getCommand(CommandType.TYPE_CHAT, command, null) != null;
411
+        return getCommand(CommandType.TYPE_CHANNEL, command) != null
412
+                || getCommand(CommandType.TYPE_CHAT, command) != null;
415 413
     }
416 414
        
417 415
     public static List<String> getCommandNames(final CommandType type) {
418 416
         final List<String> res = new ArrayList<String>();
419 417
         
420
-        for (Command command : getCommands(type, null, null)) {
418
+        for (Command command : getCommands(type)) {
421 419
             res.add(getCommandChar() + command.getName());
422 420
         }
423 421
         
@@ -425,17 +423,16 @@ public final class CommandManager {
425 423
     }
426 424
     
427 425
     public static List<Command> getCommands(final CommandType type) {    
428
-        return getCommands(type, null, null);
426
+        return getCommands(type, null);
429 427
     }
430 428
     
431 429
     private static List<Command> getCommands(final CommandType type,
432
-            final String name, final String signature) {
430
+            final String name) {
433 431
         final List<Command> res = new ArrayList<Command>();
434 432
         
435 433
         for (Map.Entry<CommandInfo, Command> entry : commands.entrySet()) {
436 434
             if ((type == null || type.equals(entry.getKey().getType()))
437
-                    && (name == null || name.equals(entry.getKey().getName()))
438
-                    && (signature == null || signature.equals(entry.getKey().getSignature()))) {
435
+                    && (name == null || name.equals(entry.getKey().getName()))) {
439 436
                 res.add(entry.getValue());
440 437
             }
441 438
         }

+ 1
- 1
src/com/dmdirc/commandparser/commands/Command.java Ver arquivo

@@ -97,7 +97,7 @@ public abstract class Command extends CommandInfo implements Comparable<Command>
97 97
     /** {@inheritDoc} */
98 98
     @Override
99 99
     public final int compareTo(final Command o) {
100
-        return getSignature().compareTo(o.getSignature());
100
+        return getName().compareTo(o.getName());
101 101
     }
102 102
 
103 103
     /** {@inheritDoc} */

+ 4
- 10
src/com/dmdirc/commandparser/commands/channel/Ban.java Ver arquivo

@@ -53,6 +53,10 @@ public final class Ban extends ChannelCommand {
53 53
      */
54 54
     public void execute(final InputWindow origin, final Server server,
55 55
             final Channel channel, final boolean isSilent, final String... args) {
56
+        if (args.length == 0) {
57
+            showUsage(origin, isSilent, "ban", "<user|host>");
58
+            return;
59
+        }
56 60
         
57 61
         String host = args[0];
58 62
         final ChannelClientInfo user = channel.getChannelInfo().getUser(args[0]);
@@ -74,16 +78,6 @@ public final class Ban extends ChannelCommand {
74 78
         return true;
75 79
     }
76 80
     
77
-    /** {@inheritDoc}. */
78
-    public boolean isPolyadic() {
79
-        return false;
80
-    }
81
-    
82
-    /** {@inheritDoc}. */
83
-    public int getArity() {
84
-        return 1;
85
-    }
86
-    
87 81
     /** {@inheritDoc}. */
88 82
     public String getHelp() {
89 83
         return "ban <user|host> - bans the specified user or host from the channel.";

+ 0
- 10
src/com/dmdirc/commandparser/commands/channel/ChannelSettings.java Ver arquivo

@@ -65,16 +65,6 @@ public final class ChannelSettings extends ChannelCommand {
65 65
         return true;
66 66
     }
67 67
     
68
-    /** {@inheritDoc}. */
69
-    public boolean isPolyadic() {
70
-        return false;
71
-    }
72
-    
73
-    /** {@inheritDoc}. */
74
-    public int getArity() {
75
-        return 0;
76
-    }
77
-    
78 68
     /** {@inheritDoc}. */
79 69
     public String getHelp() {
80 70
         return "channelsettings - opens the channel settings window";

+ 0
- 10
src/com/dmdirc/commandparser/commands/channel/Cycle.java Ver arquivo

@@ -65,16 +65,6 @@ public final class Cycle extends ChannelCommand {
65 65
         return true;
66 66
     }
67 67
     
68
-    /** {@inheritDoc}. */
69
-    public boolean isPolyadic() {
70
-        return false;
71
-    }
72
-    
73
-    /** {@inheritDoc}. */
74
-    public int getArity() {
75
-        return 0;
76
-    }
77
-    
78 68
     /** {@inheritDoc}. */
79 69
     public String getHelp() {
80 70
         return "cycle - parts and rejoins the channel";

+ 8
- 21
src/com/dmdirc/commandparser/commands/channel/KickReason.java Ver arquivo

@@ -43,14 +43,8 @@ public final class KickReason extends ChannelCommand {
43 43
         CommandManager.registerCommand(this);
44 44
     }
45 45
     
46
-    /**
47
-     * Executes this command.
48
-     * @param origin The frame in which this command was issued
49
-     * @param server The server object that this command is associated with
50
-     * @param channel The channel object that this command is associated with
51
-     * @param isSilent Whether this command is silenced or not
52
-     * @param args The user supplied arguments
53
-     */
46
+    /** {@inheritDoc} */
47
+    @Override
54 48
     public void execute(final InputWindow origin, final Server server,
55 49
             final Channel channel, final boolean isSilent, final String... args) {
56 50
         if (args.length == 0) {
@@ -67,27 +61,20 @@ public final class KickReason extends ChannelCommand {
67 61
         }
68 62
     }
69 63
     
70
-    /** {@inheritDoc}. */
64
+    /** {@inheritDoc} */
65
+    @Override
71 66
     public String getName() {
72 67
         return "kick";
73 68
     }
74 69
     
75
-    /** {@inheritDoc}. */
70
+    /** {@inheritDoc} */
71
+    @Override
76 72
     public boolean showInHelp() {
77 73
         return true;
78 74
     }
79 75
     
80
-    /** {@inheritDoc}. */
81
-    public boolean isPolyadic() {
82
-        return true;
83
-    }
84
-    
85
-    /** {@inheritDoc}. */
86
-    public int getArity() {
87
-        return 0;
88
-    }
89
-    
90
-    /** {@inheritDoc}. */
76
+    /** {@inheritDoc} */
77
+    @Override
91 78
     public String getHelp() {
92 79
         return "kick <user> [reason] - kicks the specified user from the channel";
93 80
     }

+ 8
- 21
src/com/dmdirc/commandparser/commands/channel/Mode.java Ver arquivo

@@ -42,14 +42,8 @@ public final class Mode extends ChannelCommand {
42 42
         CommandManager.registerCommand(this);
43 43
     }
44 44
     
45
-    /**
46
-     * Executes this command.
47
-     * @param origin The frame in which this command was issued
48
-     * @param server The server object that this command is associated with
49
-     * @param channel The channel object that this command is associated with
50
-     * @param isSilent Whether this command is silenced or not
51
-     * @param args The user supplied arguments
52
-     */
45
+    /** {@inheritDoc} */
46
+    @Override
53 47
     public void execute(final InputWindow origin, final Server server,
54 48
             final Channel channel, final boolean isSilent, final String... args) {
55 49
         final ChannelInfo cChannel = channel.getChannelInfo();
@@ -61,27 +55,20 @@ public final class Mode extends ChannelCommand {
61 55
         }
62 56
     }
63 57
     
64
-    /** {@inheritDoc}. */
58
+    /** {@inheritDoc} */
59
+    @Override
65 60
     public String getName() {
66 61
         return "mode";
67 62
     }
68 63
     
69
-    /** {@inheritDoc}. */
64
+    /** {@inheritDoc} */
65
+    @Override
70 66
     public boolean showInHelp() {
71 67
         return true;
72 68
     }
73 69
     
74
-    /** {@inheritDoc}. */
75
-    public boolean isPolyadic() {
76
-        return true;
77
-    }
78
-    
79
-    /** {@inheritDoc}. */
80
-    public int getArity() {
81
-        return 0;
82
-    }
83
-    
84
-    /** {@inheritDoc}. */
70
+    /** {@inheritDoc} */
71
+    @Override
85 72
     public String getHelp() {
86 73
         return "mode [changes] - displays or changes the current channel modes";
87 74
     }

+ 9
- 22
src/com/dmdirc/commandparser/commands/channel/Part.java Ver arquivo

@@ -41,14 +41,8 @@ public final class Part extends ChannelCommand {
41 41
         CommandManager.registerCommand(this);
42 42
     }
43 43
     
44
-    /**
45
-     * Executes this command.
46
-     * @param origin The frame in which this command was issued
47
-     * @param server The server object that this command is associated with
48
-     * @param channel The channel object that this command is associated with
49
-     * @param isSilent Whether this command is silenced or not
50
-     * @param args The user supplied arguments
51
-     */
44
+    /** {@inheritDoc} */
45
+    @Override
52 46
     public void execute(final InputWindow origin, final Server server,
53 47
             final Channel channel, final boolean isSilent, final String... args) {
54 48
         channel.part(args.length > 0 ? implodeArgs(args)
@@ -56,28 +50,21 @@ public final class Part extends ChannelCommand {
56 50
         channel.closeWindow();
57 51
     }
58 52
     
59
-    /** {@inheritDoc}. */
53
+    /** {@inheritDoc} */
54
+    @Override
60 55
     public String getName() {
61 56
         return "part";
62 57
     }
63 58
     
64
-    /** {@inheritDoc}. */
59
+    /** {@inheritDoc} */
60
+    @Override
65 61
     public boolean showInHelp() {
66 62
         return true;
67 63
     }
68 64
     
69
-    /** {@inheritDoc}. */
70
-    public boolean isPolyadic() {
71
-        return true;
72
-    }
73
-    
74
-    /** {@inheritDoc}. */
75
-    public int getArity() {
76
-        return 0;
77
-    }
78
-    
79
-    /** {@inheritDoc}. */
65
+    /** {@inheritDoc} */
66
+    @Override
80 67
     public String getHelp() {
81
-        return "part <reason> - parts the channel with the specified reason";
68
+        return "part [reason] - parts the channel";
82 69
     }
83 70
 }

+ 0
- 10
src/com/dmdirc/commandparser/commands/channel/SetNickColour.java Ver arquivo

@@ -118,16 +118,6 @@ public final class SetNickColour extends ChannelCommand {
118 118
         return true;
119 119
     }
120 120
     
121
-    /** {@inheritDoc}. */
122
-    public boolean isPolyadic() {
123
-        return true;
124
-    }
125
-    
126
-    /** {@inheritDoc}. */
127
-    public int getArity() {
128
-        return 0;
129
-    }
130
-    
131 121
     /** {@inheritDoc}. */
132 122
     public String getHelp() {
133 123
         return "setnickcolour [--nicklist|--text] <nick> [colour] - set the specified person's display colour";

+ 0
- 12
src/com/dmdirc/commandparser/commands/channel/SetTopic.java Ver arquivo

@@ -69,18 +69,6 @@ public final class SetTopic extends ChannelCommand {
69 69
         return true;
70 70
     }
71 71
     
72
-    /** {@inheritDoc} */
73
-    @Override
74
-    public boolean isPolyadic() {
75
-        return true;
76
-    }
77
-    
78
-    /** {@inheritDoc} */
79
-    @Override
80
-    public int getArity() {
81
-        return 0;
82
-    }
83
-    
84 72
     /** {@inheritDoc} */
85 73
     @Override
86 74
     public String getHelp() {

+ 9
- 22
src/com/dmdirc/commandparser/commands/channel/ShowTopic.java Ver arquivo

@@ -42,14 +42,8 @@ public final class ShowTopic extends ChannelCommand {
42 42
         CommandManager.registerCommand(this);
43 43
     }
44 44
     
45
-    /**
46
-     * Executes this command.
47
-     * @param origin The frame in which this command was issued
48
-     * @param server The server object that this command is associated with
49
-     * @param channel The channel object that this command is associated with
50
-     * @param isSilent Whether this command is silenced or not
51
-     * @param args The user supplied arguments
52
-     */
45
+    /** {@inheritDoc} */
46
+    @Override
53 47
     public void execute(final InputWindow origin, final Server server,
54 48
             final Channel channel, final boolean isSilent, final String... args) {
55 49
         final ChannelInfo cChannel = channel.getChannelInfo();
@@ -62,29 +56,22 @@ public final class ShowTopic extends ChannelCommand {
62 56
         }
63 57
     }
64 58
     
65
-    /** {@inheritDoc}. */
59
+    /** {@inheritDoc} */
60
+    @Override
66 61
     public String getName() {
67 62
         return "topic";
68 63
     }
69 64
     
70
-    /** {@inheritDoc}. */
65
+    /** {@inheritDoc} */
66
+    @Override
71 67
     public boolean showInHelp() {
72 68
         return true;
73 69
     }
74 70
     
75
-    /** {@inheritDoc}. */
76
-    public boolean isPolyadic() {
77
-        return false;
78
-    }
79
-    
80
-    /** {@inheritDoc}. */
81
-    public int getArity() {
82
-        return 0;
83
-    }
84
-    
85
-    /** {@inheritDoc}. */
71
+    /** {@inheritDoc} */
72
+    @Override
86 73
     public String getHelp() {
87
-        return "topic - displays the current topic";
74
+        return "topic - displays the current topic\ntopic <newtopic> - sets the channel topic";
88 75
     }
89 76
     
90 77
 }

+ 12
- 14
src/com/dmdirc/commandparser/commands/chat/Me.java Ver arquivo

@@ -42,32 +42,30 @@ public final class Me extends ChatCommand {
42 42
     }
43 43
     
44 44
     /** {@inheritDoc} */
45
+    @Override
45 46
     public void execute(final InputWindow origin, final Server server,
46 47
             final MessageTarget target, final boolean isSilent, final String... args) {
47
-        target.sendAction(implodeArgs(args));
48
+        if (args.length == 0) {
49
+            showUsage(origin, isSilent, "me", "<action>");
50
+        } else {
51
+            target.sendAction(implodeArgs(args));
52
+        }
48 53
     }
49 54
     
50
-    /** {@inheritDoc}. */
55
+    /** {@inheritDoc} */
56
+    @Override
51 57
     public String getName() {
52 58
         return "me";
53 59
     }
54 60
     
55
-    /** {@inheritDoc}. */
61
+    /** {@inheritDoc} */
62
+    @Override
56 63
     public boolean showInHelp() {
57 64
         return true;
58 65
     }
59 66
     
60
-    /** {@inheritDoc}. */
61
-    public boolean isPolyadic() {
62
-        return true;
63
-    }
64
-    
65
-    /** {@inheritDoc}. */
66
-    public int getArity() {
67
-        return 0;
68
-    }
69
-    
70
-    /** {@inheritDoc}. */
67
+    /** {@inheritDoc} */
68
+    @Override
71 69
     public String getHelp() {
72 70
         return "me <action> - sends the specified action";
73 71
     }

+ 0
- 76
src/com/dmdirc/commandparser/commands/chat/MeEmpty.java Ver arquivo

@@ -1,76 +0,0 @@
1
-/*
2
- * Copyright (c) 2006-2007 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.commands.chat;
24
-
25
-import com.dmdirc.MessageTarget;
26
-import com.dmdirc.Server;
27
-import com.dmdirc.commandparser.commands.ChatCommand;
28
-import com.dmdirc.commandparser.CommandManager;
29
-import com.dmdirc.ui.interfaces.InputWindow;
30
-
31
-/**
32
- * The me/0 command simply tells the user that the correct usage of /me requires
33
- * they pass an action to perform.
34
- * @author chris
35
- */
36
-public final class MeEmpty extends ChatCommand {
37
-    
38
-    /** Creates a new instance of MeEmpty. */
39
-    public MeEmpty() {
40
-        super();
41
-        
42
-        CommandManager.registerCommand(this);
43
-    }
44
-    
45
-    /** {@inheritDoc} */
46
-    public void execute(final InputWindow origin, final Server server,
47
-            final MessageTarget target, final boolean isSilent, final String... args) {
48
-        showUsage(origin, isSilent, "me", "<action>");
49
-    }
50
-    
51
-    /** {@inheritDoc}. */
52
-    public String getName() {
53
-        return "me";
54
-    }
55
-    
56
-    /** {@inheritDoc}. */
57
-    public boolean showInHelp() {
58
-        return false;
59
-    }
60
-    
61
-    /** {@inheritDoc}. */
62
-    public boolean isPolyadic() {
63
-        return false;
64
-    }
65
-    
66
-    /** {@inheritDoc}. */
67
-    public int getArity() {
68
-        return 0;
69
-    }
70
-    
71
-    /** {@inheritDoc}. */
72
-    public String getHelp() {
73
-        return null;
74
-    }
75
-    
76
-}

+ 0
- 10
src/com/dmdirc/commandparser/commands/global/Active.java Ver arquivo

@@ -65,16 +65,6 @@ public final class Active extends GlobalCommand {
65 65
         return true;
66 66
     }
67 67
     
68
-    /** {@inheritDoc}. */
69
-    public boolean isPolyadic() {
70
-        return true;
71
-    }
72
-    
73
-    /** {@inheritDoc}. */
74
-    public int getArity() {
75
-        return 0;
76
-    }
77
-    
78 68
     /** {@inheritDoc}. */
79 69
     public String getHelp() {
80 70
         return "active <command> - executes the command as though it had been typed in the active window";

+ 7
- 13
src/com/dmdirc/commandparser/commands/global/AllServers.java Ver arquivo

@@ -42,6 +42,7 @@ public final class AllServers extends GlobalCommand {
42 42
     }
43 43
     
44 44
     /** {@inheritDoc} */
45
+    @Override
45 46
     public void execute(final InputWindow origin, final boolean isSilent,
46 47
             final String... args) {
47 48
         final String command = implodeArgs(args);
@@ -54,27 +55,20 @@ public final class AllServers extends GlobalCommand {
54 55
     }
55 56
     
56 57
     
57
-    /** {@inheritDoc}. */
58
+    /** {@inheritDoc} */
59
+    @Override
58 60
     public String getName() {
59 61
         return "allservers";
60 62
     }
61 63
     
62
-    /** {@inheritDoc}. */
64
+    /** {@inheritDoc} */
65
+    @Override
63 66
     public boolean showInHelp() {
64 67
         return true;
65 68
     }
66 69
     
67
-    /** {@inheritDoc}. */
68
-    public boolean isPolyadic() {
69
-        return true;
70
-    }
71
-    
72
-    /** {@inheritDoc}. */
73
-    public int getArity() {
74
-        return 0;
75
-    }
76
-    
77
-    /** {@inheritDoc}. */
70
+    /** {@inheritDoc} */
71
+    @Override
78 72
     public String getHelp() {
79 73
         return "allservers <command> - executes the command as though it had been entered on all servers";
80 74
     }

+ 9
- 19
src/com/dmdirc/commandparser/commands/global/Clear.java Ver arquivo

@@ -28,6 +28,7 @@ import com.dmdirc.ui.interfaces.InputWindow;
28 28
 
29 29
 /**
30 30
  * The clear command clears the main text area of the current window.
31
+ * 
31 32
  * @author chris
32 33
  */
33 34
 public final class Clear extends GlobalCommand {
@@ -41,39 +42,28 @@ public final class Clear extends GlobalCommand {
41 42
         CommandManager.registerCommand(this);
42 43
     }
43 44
     
44
-    /**
45
-     * Executes this command.
46
-     * @param origin The frame in which this command was issued
47
-     * @param isSilent Whether this command is silenced or not
48
-     * @param args The user supplied arguments
49
-     */
45
+    /** {@inheritDoc} */
46
+    @Override
50 47
     public void execute(final InputWindow origin, final boolean isSilent, 
51 48
             final String... args) {
52 49
         origin.clear();
53 50
     }
54 51
     
55 52
     
56
-    /** {@inheritDoc}. */
53
+    /** {@inheritDoc} */
54
+    @Override
57 55
     public String getName() {
58 56
         return "clear";
59 57
     }
60 58
     
61
-    /** {@inheritDoc}. */
59
+    /** {@inheritDoc} */
60
+    @Override
62 61
     public boolean showInHelp() {
63 62
         return true;
64 63
     }
65 64
     
66
-    /** {@inheritDoc}. */
67
-    public boolean isPolyadic() {
68
-        return false;
69
-    }
70
-    
71
-    /** {@inheritDoc}. */
72
-    public int getArity() {
73
-        return 0;
74
-    }
75
-    
76
-    /** {@inheritDoc}. */
65
+    /** {@inheritDoc} */
66
+    @Override
77 67
     public String getHelp() {
78 68
         return "clear - clears the current window's text area";
79 69
     }

+ 0
- 12
src/com/dmdirc/commandparser/commands/global/Debug.java Ver arquivo

@@ -300,18 +300,6 @@ public class Debug extends GlobalCommand implements IntelligentCommand {
300 300
         return false;
301 301
     }
302 302
     
303
-    /** {@inheritDoc} */
304
-    @Override
305
-    public boolean isPolyadic() {
306
-        return true;
307
-    }
308
-    
309
-    /** {@inheritDoc} */
310
-    @Override
311
-    public int getArity() {
312
-        return 0;
313
-    }
314
-    
315 303
     /** {@inheritDoc} */
316 304
     @Override
317 305
     public String getHelp() {

+ 8
- 23
src/com/dmdirc/commandparser/commands/global/Echo.java Ver arquivo

@@ -45,16 +45,8 @@ public final class Echo extends GlobalCommand {
45 45
         CommandManager.registerCommand(this);
46 46
     }
47 47
 
48
-    /**
49
-     * Executes this command.
50
-     * 
51
-     * @param origin
52
-     *            The frame in which this command was issued
53
-     * @param isSilent
54
-     *            Whether this command is silenced or not
55
-     * @param args
56
-     *            The user supplied arguments
57
-     */
48
+    /** {@inheritDoc} */
49
+    @Override
58 50
     public void execute(final InputWindow origin, final boolean isSilent,
59 51
             final String... args) {
60 52
         if (args.length > 0 && args[0].equalsIgnoreCase("--active")) {
@@ -88,27 +80,20 @@ public final class Echo extends GlobalCommand {
88 80
         }
89 81
     }
90 82
 
91
-    /** {@inheritDoc}. */
83
+    /** {@inheritDoc} */
84
+    @Override
92 85
     public String getName() {
93 86
         return "echo";
94 87
     }
95 88
 
96
-    /** {@inheritDoc}. */
89
+    /** {@inheritDoc} */
90
+    @Override
97 91
     public boolean showInHelp() {
98 92
         return true;
99 93
     }
100 94
 
101
-    /** {@inheritDoc}. */
102
-    public boolean isPolyadic() {
103
-        return true;
104
-    }
105
-
106
-    /** {@inheritDoc}. */
107
-    public int getArity() {
108
-        return 0;
109
-    }
110
-
111
-    /** {@inheritDoc}. */
95
+    /** {@inheritDoc} */
96
+    @Override
112 97
     public String getHelp() {
113 98
         return "echo [--active|--target <window>] <line> "
114 99
                 + "- echos the specified line to the window";

+ 5
- 11
src/com/dmdirc/commandparser/commands/global/Exit.java Ver arquivo

@@ -45,6 +45,7 @@ public final class Exit extends GlobalCommand {
45 45
     }
46 46
     
47 47
     /** {@inheritDoc} */
48
+    @Override
48 49
     public void execute(final InputWindow origin, final boolean isSilent,
49 50
             final String... args) {                
50 51
         Main.quit(args.length > 0 ? implodeArgs(args)
@@ -53,26 +54,19 @@ public final class Exit extends GlobalCommand {
53 54
     
54 55
     
55 56
     /** {@inheritDoc}. */
57
+    @Override
56 58
     public String getName() {
57 59
         return "exit";
58 60
     }
59 61
     
60 62
     /** {@inheritDoc}. */
63
+    @Override
61 64
     public boolean showInHelp() {
62 65
         return true;
63 66
     }
64
-    
65
-    /** {@inheritDoc}. */
66
-    public boolean isPolyadic() {
67
-        return true;
68
-    }
69
-    
70
-    /** {@inheritDoc}. */
71
-    public int getArity() {
72
-        return 0;
73
-    }
74
-    
67
+        
75 68
     /** {@inheritDoc}. */
69
+    @Override
76 70
     public String getHelp() {
77 71
         return "exit [reason] - exits the client";
78 72
     }

+ 0
- 10
src/com/dmdirc/commandparser/commands/global/Help.java Ver arquivo

@@ -110,16 +110,6 @@ public final class Help extends ServerCommand {
110 110
         return true;
111 111
     }
112 112
     
113
-    /** {@inheritDoc}. */
114
-    public boolean isPolyadic() {
115
-        return false;
116
-    }
117
-    
118
-    /** {@inheritDoc}. */
119
-    public int getArity() {
120
-        return 0;
121
-    }
122
-    
123 113
     /** {@inheritDoc}. */
124 114
     public String getHelp() {
125 115
         return "help - shows all available client commands";

+ 14
- 17
src/com/dmdirc/commandparser/commands/global/Ifplugin.java Ver arquivo

@@ -26,7 +26,6 @@ import com.dmdirc.commandparser.CommandManager;
26 26
 import com.dmdirc.commandparser.commands.GlobalCommand;
27 27
 import com.dmdirc.commandparser.parsers.GlobalCommandParser;
28 28
 import com.dmdirc.commandparser.commands.IntelligentCommand;
29
-import com.dmdirc.plugins.Plugin;
30 29
 import com.dmdirc.plugins.PluginInfo;
31 30
 import com.dmdirc.plugins.PluginManager;
32 31
 import com.dmdirc.ui.input.AdditionalTabTargets;
@@ -52,6 +51,7 @@ public final class Ifplugin extends GlobalCommand implements IntelligentCommand
52 51
     }
53 52
     
54 53
     /** {@inheritDoc} */
54
+    @Override
55 55
     public void execute(final InputWindow origin, final boolean isSilent,
56 56
             final String... args) {
57 57
         if (args.length <= 1) {
@@ -73,46 +73,43 @@ public final class Ifplugin extends GlobalCommand implements IntelligentCommand
73 73
         
74 74
         if (result != negative) {
75 75
             if (origin == null) {
76
-                GlobalCommandParser.getGlobalCommandParser().parseCommand(null, implodeArgs(1, args));
76
+                GlobalCommandParser.getGlobalCommandParser().parseCommand(null,
77
+                        implodeArgs(1, args));
77 78
             } else {
78 79
                 origin.getCommandParser().parseCommand(origin, implodeArgs(1, args));
79 80
             }
80 81
         }
81 82
     }
82 83
     
83
-    /** {@inheritDoc}. */
84
+    /** {@inheritDoc} */
85
+    @Override
84 86
     public String getName() {
85 87
         return "ifplugin";
86 88
     }
87 89
     
88
-    /** {@inheritDoc}. */
90
+    /** {@inheritDoc} */
91
+    @Override
89 92
     public boolean showInHelp() {
90 93
         return true;
91 94
     }
92 95
     
93
-    /** {@inheritDoc}. */
94
-    public boolean isPolyadic() {
95
-        return true;
96
-    }
97
-    
98
-    /** {@inheritDoc}. */
99
-    public int getArity() {
100
-        return 0;
101
-    }
102
-    
103
-    /** {@inheritDoc}. */
96
+    /** {@inheritDoc} */
97
+    @Override
104 98
     public String getHelp() {
105
-        return "ifplugin <[!]plugin> <command> - executes a command if the specified plugin is/isn't loaded";
99
+        return "ifplugin <[!]plugin> <command> - executes a command if the " +
100
+                "specified plugin is/isn't loaded";
106 101
     }
107 102
 
108 103
     /** {@inheritDoc} */
104
+    @Override
109 105
     public AdditionalTabTargets getSuggestions(final int arg, final List<String> previousArgs) {
110 106
         final AdditionalTabTargets res = new AdditionalTabTargets();
111 107
         
112 108
         if (arg == 0) {
113 109
             res.setIncludeNormal(false);
114 110
 
115
-            for (PluginInfo possPlugin : PluginManager.getPluginManager().getPossiblePluginInfos()) {
111
+            for (PluginInfo possPlugin
112
+                    : PluginManager.getPluginManager().getPossiblePluginInfos()) {
116 113
                 res.add(possPlugin.getName());
117 114
                 res.add("!" + possPlugin.getName());
118 115
             }            

+ 6
- 11
src/com/dmdirc/commandparser/commands/global/LoadPlugin.java Ver arquivo

@@ -51,6 +51,11 @@ public final class LoadPlugin extends GlobalCommand implements IntelligentComman
51 51
     /** {@inheritDoc} */
52 52
     public void execute(final InputWindow origin, final boolean isSilent,
53 53
             final String... args) {
54
+        if (args.length == 0) {
55
+            showUsage(origin, isSilent, "loadplugin", "<plugin>");
56
+            return;
57
+        }
58
+        
54 59
         if (PluginManager.getPluginManager().addPlugin(args[0])) {
55 60
             PluginManager.getPluginManager().getPluginInfo(args[0]).loadPlugin();
56 61
             sendLine(origin, isSilent, FORMAT_OUTPUT, "Plugin loaded.");
@@ -70,19 +75,9 @@ public final class LoadPlugin extends GlobalCommand implements IntelligentComman
70 75
         return true;
71 76
     }
72 77
     
73
-    /** {@inheritDoc} */
74
-    public boolean isPolyadic() {
75
-        return false;
76
-    }
77
-    
78
-    /** {@inheritDoc} */
79
-    public int getArity() {
80
-        return 1;
81
-    }
82
-    
83 78
     /** {@inheritDoc} */
84 79
     public String getHelp() {
85
-        return "loadplugin <class> - loads the specified class as a plugin";
80
+        return "loadplugin <plugin> - loads the specified class as a plugin";
86 81
     }
87 82
     
88 83
     /** {@inheritDoc} */

+ 0
- 10
src/com/dmdirc/commandparser/commands/global/NewServer.java Ver arquivo

@@ -97,16 +97,6 @@ public final class NewServer extends GlobalCommand {
97 97
         return true;
98 98
     }
99 99
     
100
-    /** {@inheritDoc}. */
101
-    public boolean isPolyadic() {
102
-        return true;
103
-    }
104
-    
105
-    /** {@inheritDoc}. */
106
-    public int getArity() {
107
-        return 0;
108
-    }
109
-    
110 100
     /** {@inheritDoc}. */
111 101
     public String getHelp() {
112 102
         return "newserver [--ssl] <host[:port]> [password] - connect to a new server";

+ 13
- 20
src/com/dmdirc/commandparser/commands/global/Notify.java Ver arquivo

@@ -46,15 +46,15 @@ public final class Notify extends GlobalCommand {
46 46
         CommandManager.registerCommand(this);
47 47
     }
48 48
     
49
-    /**
50
-     * Executes this command.
51
-     * 
52
-     * @param origin The frame in which this command was issued
53
-     * @param isSilent Whether this command is silenced or not
54
-     * @param args The user supplied arguments
55
-     */
49
+    /** {@inheritDoc} */
50
+    @Override
56 51
     public void execute(final InputWindow origin, final boolean isSilent,
57 52
             final String... args) {
53
+        if (args.length == 0) {
54
+            showUsage(origin, isSilent, "notify", "<colour>");
55
+            return;
56
+        }
57
+        
58 58
         final Color colour = ColourManager.parseColour(args[0], null);
59 59
         
60 60
         if (colour == null) {
@@ -67,27 +67,20 @@ public final class Notify extends GlobalCommand {
67 67
         }
68 68
     }
69 69
     
70
-    /** {@inheritDoc}. */
70
+    /** {@inheritDoc} */
71
+    @Override
71 72
     public String getName() {
72 73
         return "notify";
73 74
     }
74 75
     
75
-    /** {@inheritDoc}. */
76
+    /** {@inheritDoc} */
77
+    @Override
76 78
     public boolean showInHelp() {
77 79
         return false;
78 80
     }
79 81
     
80
-    /** {@inheritDoc}. */
81
-    public boolean isPolyadic() {
82
-        return false;
83
-    }
84
-    
85
-    /** {@inheritDoc}. */
86
-    public int getArity() {
87
-        return 1;
88
-    }
89
-    
90
-    /** {@inheritDoc}. */
82
+    /** {@inheritDoc} */
83
+    @Override
91 84
     public String getHelp() {
92 85
         return "notify <colour> - sets the notification colour for this window";
93 86
     }

+ 0
- 12
src/com/dmdirc/commandparser/commands/global/OpenWindow.java Ver arquivo

@@ -91,12 +91,6 @@ public class OpenWindow extends GlobalCommand {
91 91
         }
92 92
     }
93 93
 
94
-    /** {@inheritDoc} */
95
-    @Override
96
-    public int getArity() {
97
-        return 0;
98
-    }
99
-
100 94
     /** {@inheritDoc} */
101 95
     @Override
102 96
     public String getHelp() {
@@ -110,12 +104,6 @@ public class OpenWindow extends GlobalCommand {
110 104
         return "openwindow";
111 105
     }
112 106
 
113
-    /** {@inheritDoc} */
114
-    @Override
115
-    public boolean isPolyadic() {
116
-        return true;
117
-    }
118
-
119 107
     /** {@inheritDoc} */
120 108
     @Override
121 109
     public boolean showInHelp() {

+ 0
- 10
src/com/dmdirc/commandparser/commands/global/ReloadActions.java Ver arquivo

@@ -60,16 +60,6 @@ public final class ReloadActions extends GlobalCommand {
60 60
         return true;
61 61
     }
62 62
     
63
-    /** {@inheritDoc}. */
64
-    public boolean isPolyadic() {
65
-        return false;
66
-    }
67
-    
68
-    /** {@inheritDoc}. */
69
-    public int getArity() {
70
-        return 0;
71
-    }
72
-    
73 63
     /** {@inheritDoc}. */
74 64
     public String getHelp() {
75 65
         return "reloadactions - reloads actions from disk";

+ 0
- 12
src/com/dmdirc/commandparser/commands/global/ReloadIdentities.java Ver arquivo

@@ -61,18 +61,6 @@ public class ReloadIdentities extends GlobalCommand {
61 61
         return true;
62 62
     }
63 63
 
64
-    /** {@inheritDoc} */
65
-    @Override
66
-    public boolean isPolyadic() {
67
-        return false;
68
-    }
69
-
70
-    /** {@inheritDoc} */
71
-    @Override
72
-    public int getArity() {
73
-        return 0;
74
-    }
75
-
76 64
     /** {@inheritDoc} */
77 65
     @Override
78 66
     public String getHelp() {

+ 16
- 15
src/com/dmdirc/commandparser/commands/global/ReloadPlugin.java Ver arquivo

@@ -25,15 +25,16 @@ package com.dmdirc.commandparser.commands.global;
25 25
 import com.dmdirc.commandparser.CommandManager;
26 26
 import com.dmdirc.commandparser.commands.GlobalCommand;
27 27
 import com.dmdirc.commandparser.commands.IntelligentCommand;
28
-import com.dmdirc.plugins.Plugin;
29 28
 import com.dmdirc.plugins.PluginInfo;
30 29
 import com.dmdirc.plugins.PluginManager;
31 30
 import com.dmdirc.ui.input.AdditionalTabTargets;
32 31
 import com.dmdirc.ui.interfaces.InputWindow;
32
+
33 33
 import java.util.List;
34 34
 
35 35
 /**
36 36
  * Allows the user to reload a plugin.
37
+ * 
37 38
  * @author chris
38 39
  */
39 40
 public final class ReloadPlugin extends GlobalCommand implements IntelligentCommand {
@@ -48,8 +49,14 @@ public final class ReloadPlugin extends GlobalCommand implements IntelligentComm
48 49
     }
49 50
     
50 51
     /** {@inheritDoc} */
52
+    @Override
51 53
     public void execute(final InputWindow origin, final boolean isSilent,
52 54
             final String... args) {
55
+        if (args.length == 0) {
56
+            showUsage(origin, isSilent, "reloadplugin", "<plugin>");
57
+            return;
58
+        }
59
+        
53 60
         PluginInfo plugin = PluginManager.getPluginManager().getPluginInfoByName(args[0]);
54 61
         if (plugin == null) {
55 62
             sendLine(origin, isSilent, FORMAT_ERROR, "Plugin Reloading failed - Plugin not loaded");
@@ -63,32 +70,26 @@ public final class ReloadPlugin extends GlobalCommand implements IntelligentComm
63 70
         }
64 71
     }
65 72
     
66
-    /** {@inheritDoc}. */
73
+    /** {@inheritDoc} */
74
+    @Override
67 75
     public String getName() {
68 76
         return "reloadplugin";
69 77
     }
70 78
     
71
-    /** {@inheritDoc}. */
79
+    /** {@inheritDoc} */
80
+    @Override
72 81
     public boolean showInHelp() {
73 82
         return true;
74 83
     }
75 84
     
76
-    /** {@inheritDoc}. */
77
-    public boolean isPolyadic() {
78
-        return false;
79
-    }
80
-    
81
-    /** {@inheritDoc}. */
82
-    public int getArity() {
83
-        return 1;
84
-    }
85
-    
86
-    /** {@inheritDoc}. */
85
+    /** {@inheritDoc} */
86
+    @Override
87 87
     public String getHelp() {
88
-        return "Reloadplugin <class> - Reloads the specified plugin";
88
+        return "Reloadplugin <plugin> - Reloads the specified plugin";
89 89
     }
90 90
 
91 91
     /** {@inheritDoc} */
92
+    @Override
92 93
     public AdditionalTabTargets getSuggestions(final int arg, final List<String> previousArgs) {
93 94
         final AdditionalTabTargets res = new AdditionalTabTargets();
94 95
         

+ 0
- 10
src/com/dmdirc/commandparser/commands/global/SaveConfig.java Ver arquivo

@@ -62,16 +62,6 @@ public final class SaveConfig extends GlobalCommand {
62 62
         return true;
63 63
     }
64 64
     
65
-    /** {@inheritDoc}. */
66
-    public boolean isPolyadic() {
67
-        return false;
68
-    }
69
-    
70
-    /** {@inheritDoc}. */
71
-    public int getArity() {
72
-        return 0;
73
-    }
74
-    
75 65
     /** {@inheritDoc}. */
76 66
     public String getHelp() {
77 67
         return "saveconfig - force the client to save its configuration to disk";

+ 0
- 12
src/com/dmdirc/commandparser/commands/global/Set.java Ver arquivo

@@ -203,18 +203,6 @@ public final class Set extends GlobalCommand implements IntelligentCommand {
203 203
         return true;
204 204
     }
205 205
     
206
-    /** {@inheritDoc} */
207
-    @Override
208
-    public boolean isPolyadic() {
209
-        return true;
210
-    }
211
-    
212
-    /** {@inheritDoc} */
213
-    @Override
214
-    public int getArity() {
215
-        return 0;
216
-    }
217
-    
218 206
     /** {@inheritDoc} */
219 207
     @Override
220 208
     public String getHelp() {

+ 10
- 21
src/com/dmdirc/commandparser/commands/server/AllChannels.java Ver arquivo

@@ -41,13 +41,8 @@ public final class AllChannels extends ServerCommand {
41 41
         CommandManager.registerCommand(this);
42 42
     }
43 43
     
44
-    /**
45
-     * Executes this command.
46
-     * @param origin The frame in which this command was issued
47
-     * @param server The server object that this command is associated with
48
-     * @param isSilent Whether this command is silenced or not
49
-     * @param args The user supplied arguments
50
-     */
44
+    /** {@inheritDoc} */
45
+    @Override
51 46
     public void execute(final InputWindow origin, final Server server,
52 47
             final boolean isSilent, final String... args) {
53 48
         final String command = implodeArgs(args);
@@ -60,29 +55,23 @@ public final class AllChannels extends ServerCommand {
60 55
     }
61 56
     
62 57
     
63
-    /** {@inheritDoc}. */
58
+    /** {@inheritDoc} */
59
+    @Override
64 60
     public String getName() {
65 61
         return "allchannels";
66 62
     }
67 63
     
68
-    /** {@inheritDoc}. */
64
+    /** {@inheritDoc} */
65
+    @Override
69 66
     public boolean showInHelp() {
70 67
         return true;
71 68
     }
72 69
     
73
-    /** {@inheritDoc}. */
74
-    public boolean isPolyadic() {
75
-        return true;
76
-    }
77
-    
78
-    /** {@inheritDoc}. */
79
-    public int getArity() {
80
-        return 0;
81
-    }
82
-    
83
-    /** {@inheritDoc}. */
70
+    /** {@inheritDoc} */
71
+    @Override
84 72
     public String getHelp() {
85
-        return "allchannels <command> - executes the command as though it had been entered on all channels";
73
+        return "allchannels <command> - executes the command as though it had" +
74
+                "been entered on all channels";
86 75
     }
87 76
     
88 77
 }

+ 8
- 20
src/com/dmdirc/commandparser/commands/server/Away.java Ver arquivo

@@ -42,13 +42,8 @@ public final class Away extends ServerCommand {
42 42
         CommandManager.registerCommand(this);
43 43
     }
44 44
     
45
-    /**
46
-     * Executes this command.
47
-     * @param origin The frame in which this command was issued
48
-     * @param server The server object that this command is associated with
49
-     * @param isSilent Whether this command is silenced or not
50
-     * @param args The user supplied arguments
51
-     */
45
+    /** {@inheritDoc} */
46
+    @Override
52 47
     public void execute(final InputWindow origin, final Server server,
53 48
             final boolean isSilent, final String... args) {
54 49
         final String line = implodeArgs(args);
@@ -57,27 +52,20 @@ public final class Away extends ServerCommand {
57 52
     }
58 53
     
59 54
     
60
-    /** {@inheritDoc}. */
55
+    /** {@inheritDoc} */
56
+    @Override
61 57
     public String getName() {
62 58
         return "away";
63 59
     }
64 60
     
65
-    /** {@inheritDoc}. */
61
+    /** {@inheritDoc} */
62
+    @Override
66 63
     public boolean showInHelp() {
67 64
         return true;
68 65
     }
69 66
     
70
-    /** {@inheritDoc}. */
71
-    public boolean isPolyadic() {
72
-        return true;
73
-    }
74
-    
75
-    /** {@inheritDoc}. */
76
-    public int getArity() {
77
-        return 0;
78
-    }
79
-    
80
-    /** {@inheritDoc}. */
67
+    /** {@inheritDoc} */
68
+    @Override
81 69
     public String getHelp() {
82 70
         return "away <reason> - marks you as away";
83 71
     }

+ 0
- 10
src/com/dmdirc/commandparser/commands/server/Back.java Ver arquivo

@@ -67,16 +67,6 @@ public final class Back extends ServerCommand {
67 67
         return true;
68 68
     }
69 69
     
70
-    /** {@inheritDoc}. */
71
-    public boolean isPolyadic() {
72
-        return false;
73
-    }
74
-    
75
-    /** {@inheritDoc}. */
76
-    public int getArity() {
77
-        return 0;
78
-    }
79
-    
80 70
     /** {@inheritDoc}. */
81 71
     public String getHelp() {
82 72
         return "back - unsets your away status";

+ 7
- 14
src/com/dmdirc/commandparser/commands/server/ChangeServer.java Ver arquivo

@@ -43,6 +43,7 @@ public final class ChangeServer extends ServerCommand {
43 43
     }
44 44
     
45 45
     /** {@inheritDoc} */
46
+    @Override
46 47
     public void execute(final InputWindow origin, final Server server,
47 48
             final boolean isSilent, final String... args) {
48 49
         if (args.length == 0) {
@@ -84,28 +85,20 @@ public final class ChangeServer extends ServerCommand {
84 85
         server.connect(host, port, pass, ssl, server.getProfile());
85 86
     }
86 87
     
87
-    
88
-    /** {@inheritDoc}. */
88
+    /** {@inheritDoc} */
89
+    @Override
89 90
     public String getName() {
90 91
         return "server";
91 92
     }
92 93
     
93
-    /** {@inheritDoc}. */
94
+    /** {@inheritDoc} */
95
+    @Override
94 96
     public boolean showInHelp() {
95 97
         return true;
96 98
     }
97 99
     
98
-    /** {@inheritDoc}. */
99
-    public boolean isPolyadic() {
100
-        return true;
101
-    }
102
-    
103
-    /** {@inheritDoc}. */
104
-    public int getArity() {
105
-        return 0;
106
-    }
107
-    
108
-    /** {@inheritDoc}. */
100
+    /** {@inheritDoc} */
101
+    @Override
109 102
     public String getHelp() {
110 103
         return "server [--ssl] <host[:port]> [password] - connect to a different server";
111 104
     }

+ 0
- 10
src/com/dmdirc/commandparser/commands/server/Ctcp.java Ver arquivo

@@ -75,16 +75,6 @@ public final class Ctcp extends ServerCommand implements IntelligentCommand {
75 75
         return true;
76 76
     }
77 77
     
78
-    /** {@inheritDoc}. */
79
-    public boolean isPolyadic() {
80
-        return true;
81
-    }
82
-    
83
-    /** {@inheritDoc}. */
84
-    public int getArity() {
85
-        return 0;
86
-    }
87
-    
88 78
     /** {@inheritDoc}. */
89 79
     public String getHelp() {
90 80
         return "ctcp <target> <type> [arguments] - sends a CTCP message";

+ 0
- 10
src/com/dmdirc/commandparser/commands/server/Disconnect.java Ver arquivo

@@ -73,16 +73,6 @@ public final class Disconnect extends ServerCommand {
73 73
         return true;
74 74
     }
75 75
     
76
-    /** {@inheritDoc}. */
77
-    public boolean isPolyadic() {
78
-        return true;
79
-    }
80
-    
81
-    /** {@inheritDoc}. */
82
-    public int getArity() {
83
-        return 0;
84
-    }
85
-    
86 76
     /** {@inheritDoc}. */
87 77
     public String getHelp() {
88 78
         return "disconnect [reason] - disconnect from this server";

+ 7
- 13
src/com/dmdirc/commandparser/commands/server/Ignore.java Ver arquivo

@@ -52,6 +52,7 @@ public final class Ignore extends ServerCommand {
52 52
      * @param isSilent Whether this command is silenced or not
53 53
      * @param args The user supplied arguments
54 54
      */
55
+    @Override
55 56
     public void execute(final InputWindow origin, final Server server,
56 57
             final boolean isSilent, final String... args) {
57 58
         
@@ -133,27 +134,20 @@ public final class Ignore extends ServerCommand {
133 134
         
134 135
     }
135 136
     
136
-    /** {@inheritDoc}. */
137
+    /** {@inheritDoc} */
138
+    @Override
137 139
     public String getName() {
138 140
         return "ignore";
139 141
     }
140 142
     
141
-    /** {@inheritDoc}. */
143
+    /** {@inheritDoc} */
144
+    @Override
142 145
     public boolean showInHelp() {
143 146
         return true;
144 147
     }
145 148
     
146
-    /** {@inheritDoc}. */
147
-    public boolean isPolyadic() {
148
-        return true;
149
-    }
150
-    
151
-    /** {@inheritDoc}. */
152
-    public int getArity() {
153
-        return 0;
154
-    }
155
-    
156
-    /** {@inheritDoc}. */
149
+    /** {@inheritDoc} */
150
+    @Override
157 151
     public String getHelp() {
158 152
         return "ignore <add|remove|view> [host] - manages the network's ignore list";
159 153
     }

+ 8
- 20
src/com/dmdirc/commandparser/commands/server/Message.java Ver arquivo

@@ -42,13 +42,8 @@ public final class Message extends ServerCommand {
42 42
         CommandManager.registerCommand(this);
43 43
     }
44 44
     
45
-    /**
46
-     * Executes this command.
47
-     * @param origin The frame in which this command was issued
48
-     * @param server The server object that this command is associated with
49
-     * @param isSilent Whether this command is silenced or not
50
-     * @param args The user supplied arguments
51
-     */
45
+    /** {@inheritDoc} */
46
+    @Override
52 47
     public void execute(final InputWindow origin, final Server server,
53 48
             final boolean isSilent, final String... args) {
54 49
         if (args.length < 2) {
@@ -61,27 +56,20 @@ public final class Message extends ServerCommand {
61 56
     }
62 57
     
63 58
     
64
-    /** {@inheritDoc}. */
59
+    /** {@inheritDoc} */
60
+    @Override
65 61
     public String getName() {
66 62
         return "msg";
67 63
     }
68 64
     
69
-    /** {@inheritDoc}. */
65
+    /** {@inheritDoc} */
66
+    @Override
70 67
     public boolean showInHelp() {
71 68
         return true;
72 69
     }
73 70
     
74
-    /** {@inheritDoc}. */
75
-    public boolean isPolyadic() {
76
-        return true;
77
-    }
78
-    
79
-    /** {@inheritDoc}. */
80
-    public int getArity() {
81
-        return 0;
82
-    }
83
-    
84
-    /** {@inheritDoc}. */
71
+    /** {@inheritDoc} */
72
+    @Override
85 73
     public String getHelp() {
86 74
         return "msg <target> <message> - sends a private message";
87 75
     }

+ 0
- 85
src/com/dmdirc/commandparser/commands/server/Motd.java Ver arquivo

@@ -1,85 +0,0 @@
1
-/*
2
- * Copyright (c) 2006-2007 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.commands.server;
24
-
25
-import com.dmdirc.Server;
26
-import com.dmdirc.commandparser.CommandManager;
27
-import com.dmdirc.commandparser.commands.ServerCommand;
28
-import com.dmdirc.ui.interfaces.InputWindow;
29
-
30
-/**
31
- * The MOTD command allows the user to retrieve the MOTD for the server.
32
- * @author chris
33
- */
34
-public final class Motd extends ServerCommand {
35
-    
36
-    /**
37
-     * Creates a new instance of Motd.
38
-     */
39
-    public Motd() {
40
-        super();
41
-        
42
-        CommandManager.registerCommand(this);
43
-    }
44
-    
45
-    /**
46
-     * Executes this command.
47
-     * @param origin The frame in which this command was issued
48
-     * @param server The server object that this command is associated with
49
-     * @param isSilent Whether this command is silenced or not
50
-     * @param args The user supplied arguments
51
-     */
52
-    public void execute(final InputWindow origin, final Server server,
53
-            final boolean isSilent, final String... args) {
54
-        //final String line = implodeArgs(args);
55
-        
56
-        server.getParser().sendLine("MOTD");
57
-    }
58
-    
59
-    
60
-    /** {@inheritDoc}. */
61
-    public String getName() {
62
-        return "motd";
63
-    }
64
-    
65
-    /** {@inheritDoc}. */
66
-    public boolean showInHelp() {
67
-        return true;
68
-    }
69
-    
70
-    /** {@inheritDoc}. */
71
-    public boolean isPolyadic() {
72
-        return false;
73
-    }
74
-    
75
-    /** {@inheritDoc}. */
76
-    public int getArity() {
77
-        return 0;
78
-    }
79
-    
80
-    /** {@inheritDoc}. */
81
-    public String getHelp() {
82
-        return "motd - retrieves the server's message of the day";
83
-    }
84
-    
85
-}

+ 5
- 10
src/com/dmdirc/commandparser/commands/server/Nick.java Ver arquivo

@@ -51,6 +51,11 @@ public final class Nick extends ServerCommand {
51 51
      */
52 52
     public void execute(final InputWindow origin, final Server server,
53 53
             final boolean isSilent, final String... args) {
54
+        if (args.length == 0) {
55
+            showUsage(origin, isSilent, "nick", "<new nickname>");
56
+            return;
57
+        }
58
+        
54 59
         server.getParser().setNickname(args[0]);
55 60
     }
56 61
     
@@ -65,16 +70,6 @@ public final class Nick extends ServerCommand {
65 70
         return true;
66 71
     }
67 72
     
68
-    /** {@inheritDoc}. */
69
-    public boolean isPolyadic() {
70
-        return false;
71
-    }
72
-    
73
-    /** {@inheritDoc}. */
74
-    public int getArity() {
75
-        return 1;
76
-    }
77
-    
78 73
     /** {@inheritDoc}. */
79 74
     public String getHelp() {
80 75
         return "nick <new nickname> - attempts to change your nickname to the one specified";

+ 8
- 20
src/com/dmdirc/commandparser/commands/server/Notice.java Ver arquivo

@@ -42,13 +42,8 @@ public final class Notice extends ServerCommand {
42 42
         CommandManager.registerCommand(this);
43 43
     }
44 44
     
45
-    /**
46
-     * Executes this command.
47
-     * @param origin The frame in which this command was issued
48
-     * @param server The server object that this command is associated with
49
-     * @param isSilent Whether this command is silenced or not
50
-     * @param args The user supplied arguments
51
-     */
45
+    /** {@inheritDoc} */
46
+    @Override
52 47
     public void execute(final InputWindow origin, final Server server,
53 48
             final boolean isSilent, final String... args) {
54 49
         if (args.length < 2) {
@@ -61,27 +56,20 @@ public final class Notice extends ServerCommand {
61 56
     }
62 57
     
63 58
     
64
-    /** {@inheritDoc}. */
59
+    /** {@inheritDoc} */
60
+    @Override
65 61
     public String getName() {
66 62
         return "notice";
67 63
     }
68 64
     
69
-    /** {@inheritDoc}. */
65
+    /** {@inheritDoc} */
66
+    @Override
70 67
     public boolean showInHelp() {
71 68
         return true;
72 69
     }
73 70
     
74
-    /** {@inheritDoc}. */
75
-    public boolean isPolyadic() {
76
-        return true;
77
-    }
78
-    
79
-    /** {@inheritDoc}. */
80
-    public int getArity() {
81
-        return 0;
82
-    }
83
-    
84
-    /** {@inheritDoc}. */
71
+    /** {@inheritDoc} */
72
+    @Override
85 73
     public String getHelp() {
86 74
         return "notice <target> <message> - sends a notice";
87 75
     }

+ 7
- 13
src/com/dmdirc/commandparser/commands/server/Query.java Ver arquivo

@@ -44,6 +44,7 @@ public final class Query extends ServerCommand {
44 44
     }
45 45
     
46 46
     /** {@inheritDoc} */
47
+    @Override
47 48
     public void execute(final InputWindow origin, final Server server,
48 49
             final boolean isSilent, final String... args) {
49 50
         if (args.length == 0) {
@@ -63,27 +64,20 @@ public final class Query extends ServerCommand {
63 64
     }
64 65
     
65 66
     
66
-    /** {@inheritDoc}. */
67
+    /** {@inheritDoc} */
68
+    @Override
67 69
     public String getName() {
68 70
         return "query";
69 71
     }
70 72
     
71
-    /** {@inheritDoc}. */
73
+    /** {@inheritDoc} */
74
+    @Override
72 75
     public boolean showInHelp() {
73 76
         return true;
74 77
     }
75 78
     
76
-    /** {@inheritDoc}. */
77
-    public boolean isPolyadic() {
78
-        return true;
79
-    }
80
-    
81
-    /** {@inheritDoc}. */
82
-    public int getArity() {
83
-        return 0;
84
-    }
85
-    
86
-    /** {@inheritDoc}. */
79
+    /** {@inheritDoc} */
80
+    @Override
87 81
     public String getHelp() {
88 82
         return "query <user> [message] - opens a query with the specified user";
89 83
     }

+ 0
- 10
src/com/dmdirc/commandparser/commands/server/Raw.java Ver arquivo

@@ -69,16 +69,6 @@ public final class Raw extends ServerCommand {
69 69
         return true;
70 70
     }
71 71
     
72
-    /** {@inheritDoc}. */
73
-    public boolean isPolyadic() {
74
-        return true;
75
-    }
76
-    
77
-    /** {@inheritDoc}. */
78
-    public int getArity() {
79
-        return 0;
80
-    }
81
-    
82 72
     /** {@inheritDoc}. */
83 73
     public String getHelp() {
84 74
         return "raw <text> - sends the specified text directly to the server";

+ 7
- 13
src/com/dmdirc/commandparser/commands/server/RawServerCommand.java Ver arquivo

@@ -51,33 +51,27 @@ public final class RawServerCommand extends ServerCommand {
51 51
     }
52 52
     
53 53
     /** {@inheritDoc} */
54
+    @Override
54 55
     public void execute(final InputWindow origin, final Server server,
55 56
             final boolean isSilent, final String... args) {
56 57
         server.getParser().sendLine(myName.toUpperCase() + " " + implodeArgs(args));
57 58
     }
58 59
     
59 60
     
60
-    /** {@inheritDoc}. */
61
+    /** {@inheritDoc} */
62
+    @Override
61 63
     public String getName() {
62 64
         return myName;
63 65
     }
64 66
     
65
-    /** {@inheritDoc}. */
67
+    /** {@inheritDoc} */
68
+    @Override
66 69
     public boolean showInHelp() {
67 70
         return true;
68 71
     }
69 72
     
70
-    /** {@inheritDoc}. */
71
-    public boolean isPolyadic() {
72
-        return true;
73
-    }
74
-    
75
-    /** {@inheritDoc}. */
76
-    public int getArity() {
77
-        return 0;
78
-    }
79
-    
80
-    /** {@inheritDoc}. */
73
+    /** {@inheritDoc} */
74
+    @Override
81 75
     public String getHelp() {
82 76
         return myName + " [arguments] - sends a " + myName + " command to the server";
83 77
     }

+ 8
- 20
src/com/dmdirc/commandparser/commands/server/Reconnect.java Ver arquivo

@@ -42,13 +42,8 @@ public final class Reconnect extends ServerCommand {
42 42
         CommandManager.registerCommand(this);
43 43
     }
44 44
     
45
-    /**
46
-     * Executes this command.
47
-     * @param origin The frame in which this command was issued
48
-     * @param server The server object that this command is associated with
49
-     * @param isSilent Whether this command is silenced or not
50
-     * @param args The user supplied arguments
51
-     */
45
+    /** {@inheritDoc} */
46
+    @Override
52 47
     public void execute(final InputWindow origin, final Server server,
53 48
             final boolean isSilent, final String... args) {
54 49
         String line;
@@ -63,27 +58,20 @@ public final class Reconnect extends ServerCommand {
63 58
     }
64 59
     
65 60
     
66
-    /** {@inheritDoc}. */
61
+    /** {@inheritDoc} */
62
+    @Override
67 63
     public String getName() {
68 64
         return "reconnect";
69 65
     }
70 66
     
71
-    /** {@inheritDoc}. */
67
+    /** {@inheritDoc} */
68
+    @Override
72 69
     public boolean showInHelp() {
73 70
         return true;
74 71
     }
75 72
     
76
-    /** {@inheritDoc}. */
77
-    public boolean isPolyadic() {
78
-        return true;
79
-    }
80
-    
81
-    /** {@inheritDoc}. */
82
-    public int getArity() {
83
-        return 0;
84
-    }
85
-    
86
-    /** {@inheritDoc}. */
73
+    /** {@inheritDoc} */
74
+    @Override
87 75
     public String getHelp() {
88 76
         return "reconnect [reason] - reconnect to this server";
89 77
     }

+ 5
- 11
src/com/dmdirc/commandparser/parsers/CommandParser.java Ver arquivo

@@ -78,7 +78,7 @@ public abstract class CommandParser implements Serializable {
78 78
      * @param command Command to be registered
79 79
      */
80 80
     public final void registerCommand(final Command command) {
81
-        commands.put(command.getSignature().toLowerCase(), command);
81
+        commands.put(command.getName().toLowerCase(), command);
82 82
     }
83 83
     
84 84
     /**
@@ -87,7 +87,7 @@ public abstract class CommandParser implements Serializable {
87 87
      * @param command Command to be unregistered
88 88
      */
89 89
     public final void unregisterCommand(final Command command) {
90
-        commands.remove(command.getSignature().toLowerCase());
90
+        commands.remove(command.getName().toLowerCase());
91 91
     }
92 92
     
93 93
     /**
@@ -145,18 +145,12 @@ public abstract class CommandParser implements Serializable {
145 145
             
146 146
             System.arraycopy(args, 1, comargs, 0, args.length - 1);
147 147
             
148
-            final String signature = command + "/" + (comargs.length);
148
+            final String signature = command;
149 149
             
150
-            // Check the specific signature first, so that polyadic commands can
151
-            // have error handlers if there are too few arguments (e.g., msg/0 and
152
-            // msg/1 would return errors, so msg only gets called with 2+ args).
153 150
             if (commands.containsKey(signature.toLowerCase())) {
154 151
                 addHistory(command, comargs);
155 152
                 executeCommand(origin, silent, commands.get(signature.toLowerCase()), comargs);
156
-            } else if (commands.containsKey(command.toLowerCase())) {
157
-                addHistory(command, comargs);
158
-                executeCommand(origin, silent, commands.get(command.toLowerCase()), comargs);
159
-            } else {
153
+           } else {
160 154
                 handleInvalidCommand(origin, command, comargs);
161 155
             }
162 156
         } else {
@@ -256,7 +250,7 @@ public abstract class CommandParser implements Serializable {
256 250
             ActionManager.processEvent(CoreActionType.UNKNOWN_COMMAND, buff,
257 251
                     origin.getContainer(), command, args);
258 252
             
259
-            origin.addLine(buff, command + "/" + args.length);
253
+            origin.addLine(buff, command);
260 254
         }
261 255
     }
262 256
     

Carregando…
Cancelar
Salvar