add 'bye' command (currently ignored), harmonize errors due to wrong number of arguments
This commit is contained in:
@@ -36,7 +36,7 @@
|
||||
/***************************************************************
|
||||
* Tells the server the client has another screen to offer
|
||||
*
|
||||
* usage: screen_add <id>
|
||||
* Usage: screen_add <id>
|
||||
*/
|
||||
int
|
||||
screen_add_func (Client * c, int argc, char **argv)
|
||||
@@ -48,14 +48,7 @@ screen_add_func (Client * c, int argc, char **argv)
|
||||
return 1;
|
||||
|
||||
if (argc != 2) {
|
||||
switch (argc) {
|
||||
case 1:
|
||||
sock_send_error(c->sock, "Usage: screen_add <screenid>\n");
|
||||
break;
|
||||
default:
|
||||
sock_send_error(c->sock, "Too many parameters...\n");
|
||||
break;
|
||||
}
|
||||
sock_send_error(c->sock, "Usage: screen_add <screenid>\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -87,7 +80,7 @@ screen_add_func (Client * c, int argc, char **argv)
|
||||
/****************************************************************
|
||||
* Client requests that the server forget about a screen
|
||||
*
|
||||
* usage: screen_del <screenid>
|
||||
* Usage: screen_del <screenid>
|
||||
*/
|
||||
int
|
||||
screen_del_func (Client * c, int argc, char **argv)
|
||||
@@ -99,10 +92,7 @@ screen_del_func (Client * c, int argc, char **argv)
|
||||
return 1;
|
||||
|
||||
if (argc != 2) {
|
||||
if (argc == 1)
|
||||
sock_send_error(c->sock, "Usage: screen_del <screenid>\n");
|
||||
else
|
||||
sock_send_error(c->sock, "Too many parameters...\n");
|
||||
sock_send_error(c->sock, "Usage: screen_del <screenid>\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -132,10 +122,10 @@ screen_del_func (Client * c, int argc, char **argv)
|
||||
* Configures info about a particular screen, such as its
|
||||
* name, priority, or duration
|
||||
*
|
||||
* usage: screen_set <id> [ -name <name> ] [ -wid <width> ] [ -hgt <height> ]
|
||||
* [ -priority <prio> ] [ -duration <int> ] [ -timeout <int> ]
|
||||
* [ -heartbeat <type> ] [ -backlight <type> ]
|
||||
* [ -cursor <type> ] [ -cursor_x <xpos> ] [ -cursor_y <ypos> ]
|
||||
* Usage: screen_set <id> [-name <name>] [-wid <width>] [-hgt <height>]
|
||||
* [-priority <prio>] [-duration <int>] [-timeout <int>]
|
||||
* [-heartbeat <type>] [-backlight <type>]
|
||||
* [-cursor <type>] [-cursor_x <xpos>] [-cursor_y <ypos>]
|
||||
*/
|
||||
int
|
||||
screen_set_func (Client * c, int argc, char **argv)
|
||||
@@ -150,12 +140,12 @@ screen_set_func (Client * c, int argc, char **argv)
|
||||
return 1;
|
||||
|
||||
if (argc == 1) {
|
||||
sock_send_error(c->sock, "Usage: screen_set <id> [ -name <name> ]"
|
||||
" [ -wid <width> ] [ -hgt <height> [ -priority <int> ]"
|
||||
" [ -duration <int> ] [ -timeout <int> ]"
|
||||
" [ -heartbeat <type> ] [ -backlight <type> ]"
|
||||
" [ -cursor <type> ]"
|
||||
" [ -cursor_x <xpos> ] [ -cursor_y <ypos> ]\n");
|
||||
sock_send_error(c->sock, "Usage: screen_set <id> [-name <name>]"
|
||||
" [-wid <width>] [-hgt <height>] [-priority <int>]"
|
||||
" [-duration <int>] [-timeout <int>]"
|
||||
" [-heartbeat <type>] [-backlight <type>]"
|
||||
" [-cursor <type>]"
|
||||
" [-cursor_x <xpos>] [-cursor_y <ypos>]\n");
|
||||
return 0;
|
||||
} else if (argc == 2) {
|
||||
sock_send_error(c->sock, "What do you want to set?\n");
|
||||
@@ -414,7 +404,7 @@ screen_set_func (Client * c, int argc, char **argv)
|
||||
* Tells the server the client would like to accept keypresses
|
||||
* of a particular type when the given screen is active on the display
|
||||
*
|
||||
* screen_add_key <screenid> <keylist>
|
||||
* Usage: screen_add_key <screenid> <keylist>
|
||||
*/
|
||||
int
|
||||
screen_add_key_func (Client * c, int argc, char **argv)
|
||||
@@ -489,7 +479,7 @@ screen_add_key_func (Client * c, int argc, char **argv)
|
||||
* Tells the server the client would NOT like to accept keypresses
|
||||
* of a particular type when the given screen is active on the display
|
||||
*
|
||||
* usage: screen_del_key <screenid> <keylist>
|
||||
* Usage: screen_del_key <screenid> <keylist>
|
||||
*/
|
||||
int
|
||||
screen_del_key_func (Client * c, int argc, char **argv)
|
||||
|
||||
Reference in New Issue
Block a user