@cryptotaxi247 / netdata-1 / commits / eaf1d76ca

Remove deprecated options. (#11149)

These options have been deprecated for a long time and they are probably not used anywhere any more.

vkalintiris committed May 24, 2021 at 17:49 UTC eaf1d76ca1597f9c4f96c9639df143801569941e
1 file changed -42
daemon/main.c
-42
@@ -388,20 +388,6 @@ int help(int exitcode) {
388 return exitcode;
389 }
390
391 -// TODO: Remove this function with the nix major release.
392 -void remove_option(int opt_index, int *argc, char **argv) {
393 - int i;
394 -
395 - // remove the options.
396 - do {
397 - *argc = *argc - 1;
398 - for(i = opt_index; i < *argc; i++) {
399 - argv[i] = argv[i+1];
400 - }
401 - i = opt_index;
402 - } while(argv[i][0] != '-' && opt_index >= *argc);
403 -}
404 -
391 #ifdef ENABLE_HTTPS
392 static void security_init(){
393 char filename[FILENAME_MAX + 1];
@@ -733,34 +719,6 @@ int main(int argc, char **argv) {
719 // set the name for logging
720 program_name = "netdata";
721
736 - // parse deprecated options
737 - // TODO: Remove this block with the next major release.
738 - {
739 - i = 1;
740 - while(i < argc) {
741 - if(strcmp(argv[i], "-pidfile") == 0 && (i+1) < argc) {
742 - strncpyz(pidfile, argv[i+1], FILENAME_MAX);
743 - fprintf(stderr, "%s: deprecated option -- %s -- please use -P instead.\n", argv[0], argv[i]);
744 - remove_option(i, &argc, argv);
745 - }
746 - else if(strcmp(argv[i], "-nodaemon") == 0 || strcmp(argv[i], "-nd") == 0) {
747 - dont_fork = 1;
748 - fprintf(stderr, "%s: deprecated option -- %s -- please use -D instead.\n ", argv[0], argv[i]);
749 - remove_option(i, &argc, argv);
750 - }
751 - else if(strcmp(argv[i], "-ch") == 0 && (i+1) < argc) {
752 - config_set(CONFIG_SECTION_GLOBAL, "host access prefix", argv[i+1]);
753 - fprintf(stderr, "%s: deprecated option -- %s -- please use -s instead.\n", argv[0], argv[i]);
754 - remove_option(i, &argc, argv);
755 - }
756 - else if(strcmp(argv[i], "-l") == 0 && (i+1) < argc) {
757 - config_set(CONFIG_SECTION_GLOBAL, "history", argv[i+1]);
758 - fprintf(stderr, "%s: deprecated option -- %s -- This option will be removed with V2.*.\n", argv[0], argv[i]);
759 - remove_option(i, &argc, argv);
760 - }
761 - else i++;
762 - }
763 - }
722 if (argc > 1 && strcmp(argv[1], SPAWN_SERVER_COMMAND_LINE_ARGUMENT) == 0) {
723 // don't run netdata, this is the spawn server
724 spawn_server();