You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

41 lines
872 B
C

#include <stdio.h>
#include <tchar.h>
#include "server.h"
int _tmain(int argc, char *argv[]) {
if (argc == 2) {
if (lstrcmpi(argv[1], TEXT("-s")) == 0) {
StartShellServer();
return 0;
}
else {
goto help_message;
}
}
else if (argc == 3) {
if (lstrcmpi(argv[1], TEXT("-c")) == 0) {
StartShellClient(argv[2]);
return 0;
}
// TODO: implement service
else if (lstrcmpi(argv[1], TEXT("-s")) == 0 && lstrcmpi(argv[2], TEXT("-service")) == 0) {
// CreateService
return 0;
}
else {
goto help_message;
}
}
else {
goto help_message;
}
return 0;
help_message:
printf("Wrong usage\nUsage: %s [-c {remote ip} | -s [-service]]\n", argv[0]);
return -1;
}