aboutsummaryrefslogtreecommitdiff
path: root/server-cli.c
diff options
context:
space:
mode:
Diffstat (limited to 'server-cli.c')
-rw-r--r--server-cli.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/server-cli.c b/server-cli.c
index 82c9501..58e5ea4 100644
--- a/server-cli.c
+++ b/server-cli.c
@@ -17,7 +17,7 @@ void handleCLI(sds **vhosts, int vhostsc) {
char name[MAX_LEN_COMMAND+1];
int argsAssigned = sscanf(line, COMMAND_FORMAT, name);
- while (name[0] != 'q' && name[0] != 'e' && !streq(name, "quit") && !streq(name, "exit")) {
+ while (!streq(name, "q") && !streq(name, "e") && !streq(name, "quit") && !streq(name, "exit")) {
if (argsAssigned < 1) {
printf("Bad command syntax!\n");
}
@@ -29,8 +29,8 @@ void handleCLI(sds **vhosts, int vhostsc) {
vhosts[i][vh_error]);
}
}
- else if (streq(name, "help")) {
- printf("help\tPrints this message\nvhosts\tPrints all registered virtual hosts\n");
+ else if (streq(name, "help") || streq(name, "h") || streq(name, "?")) {
+ printf("help,h,?\tPrints this message\nvhosts\t\tPrints all registered virtual hosts\nquit,exit,q,e\tExits the program\n");
}
else {
printf("Unknown command %s!\n", name);