add 'bye' command (currently ignored), harmonize errors due to wrong number of arguments

This commit is contained in:
marschap
2006-05-07 16:49:31 +00:00
parent 6355b22b31
commit 08bb695d8d
7 changed files with 64 additions and 94 deletions
+4 -10
View File
@@ -35,7 +35,7 @@
/****************************************************************************
* Sets the state of the output port (such as on MtxOrb LCDs)
*
* usage: output <on|off|int>
* Usage: output <on|off|int>
*/
#define ALL_OUTPUTS_ON -1
#define ALL_OUTPUTS_OFF 0
@@ -47,10 +47,7 @@ output_func (Client * c, int argc, char **argv)
char str[128];
if (argc != 2) {
if (argc == 1)
sock_send_error(c->sock, "usage: output <on|off|num> -- num may be decimal, hex, or octal\n");
else
sock_send_error(c->sock, "Too many parameters...\n");
sock_send_error(c->sock, "Usage: output {on|off|<num>}\n");
return 0;
}
@@ -120,7 +117,7 @@ output_func (Client * c, int argc, char **argv)
/*******************************************************************************
* sleep_func
*
* usage: sleep <seconds>
* Usage: sleep <seconds>
*/
int
sleep_func (Client * c, int argc, char **argv)
@@ -134,10 +131,7 @@ sleep_func (Client * c, int argc, char **argv)
#define MIN_SECS 1
if (argc != 2) {
if (argc == 1)
sock_send_error(c->sock, "usage: sleep <secs>\n");
else
sock_send_error(c->sock, "Too many parameters...\n");
sock_send_error(c->sock, "Usage: sleep <secs>\n");
return 0;
}