aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSyndamia <kamen@syndamia.com>2024-01-03 12:36:56 +0200
committerSyndamia <kamen@syndamia.com>2024-01-03 12:36:56 +0200
commitce4429042076cd76acc70d729e889fa1ad57b467 (patch)
tree62a820f04022266386e0b5c86463e78811cae1d4
parent83748b320779c891c8dbef6720acfa6f6f3f39a7 (diff)
downloadpico-web-ce4429042076cd76acc70d729e889fa1ad57b467.tar
pico-web-ce4429042076cd76acc70d729e889fa1ad57b467.tar.gz
pico-web-ce4429042076cd76acc70d729e889fa1ad57b467.zip
[server-cli] Improved help message and added :h and :?
-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);