Show an error message if an unknown option is supplied to telldusd in Linux

This commit is contained in:
Micke Prag 2011-10-26 17:02:34 +02:00
parent e3587763ee
commit d7e76f1bc1

View file

@ -46,17 +46,18 @@ int main(int argc, char **argv) {
for (int i = 1; i < argc; ++i) {
if (strcmp(argv[i], "--nodaemon") == 0) {
deamonize = false;
}
if (strcmp(argv[i], "--help") == 0) {
} else if (strcmp(argv[i], "--help") == 0) {
printf("Telldus TellStick background service\n\nStart with --nodaemon to not run as daemon\n\n");
printf("Report bugs to <info.tech@telldus.com>\n");
exit(EXIT_SUCCESS);
}
if (strcmp(argv[i], "--version") == 0) {
} else if (strcmp(argv[i], "--version") == 0) {
printf("telldusd " VERSION "\n\n");
printf("Copyright (C) 2011 Telldus Technologies AB\n\n");
printf("Written by Micke Prag <micke.prag@telldus.se>\n");
exit(EXIT_SUCCESS);
} else {
printf("Unknown option %s\n", argv[i]);
exit(EXIT_FAILURE);
}
}