diff --git a/src/daemon/main.c b/src/daemon/main.c index 558bc2aa9ff423..652f05f61d067f 100644 --- a/src/daemon/main.c +++ b/src/daemon/main.c @@ -734,21 +734,25 @@ void cancel_main_threads() { freez(static_threads); } -struct option_def option_definitions[] = { - // opt description arg name default value - { 'c', "Configuration file to load.", "filename", CONFIG_DIR "/" CONFIG_FILENAME}, - { 'D', "Do not fork. Run in the foreground.", NULL, "run in the background"}, - { 'd', "Fork. Run in the background.", NULL, "run in the background"}, - { 'h', "Display this help message.", NULL, NULL}, - { 'P', "File to save a pid while running.", "filename", "do not save pid to a file"}, - { 'i', "The IP address to listen to.", "IP", "all IP addresses IPv4 and IPv6"}, - { 'p', "API/Web port to use.", "port", "19999"}, - { 's', "Prefix for /proc and /sys (for containers).", "path", "no prefix"}, - { 't', "The internal clock of netdata.", "seconds", "1"}, - { 'u', "Run as user.", "username", "netdata"}, - { 'v', "Print netdata version and exit.", NULL, NULL}, - { 'V', "Print netdata version and exit.", NULL, NULL}, - { 'W', "See Advanced options below.", "options", NULL}, +static const struct option_def { + const char val; + const char *description; + const char *arg_name; + const char *default_value; +} option_definitions[] = { + {'c', "Configuration file to load.", "filename", CONFIG_DIR "/" CONFIG_FILENAME}, + {'D', "Do not fork. Run in the foreground.", NULL, "run in the background"}, + {'d', "Fork. Run in the background.", NULL, "run in the background"}, + {'h', "Display this help message.", NULL, NULL}, + {'P', "File to save a pid while running.", "filename", "do not save pid to a file"}, + {'i', "The IP address to listen to.", "IP", "all IP addresses IPv4 and IPv6"}, + {'p', "API/Web port to use.", "port", "19999"}, + {'s', "Prefix for /proc and /sys (for containers).", "path", "no prefix"}, + {'t', "The internal clock of netdata.", "seconds", "1"}, + {'u', "Run as user.", "username", "netdata"}, + {'v', "Print netdata version and exit.", NULL, NULL}, + {'V', "Print netdata version and exit.", NULL, NULL}, + {'W', "See Advanced options below.", "options", NULL}, }; int help(int exitcode) { diff --git a/src/daemon/main.h b/src/daemon/main.h index 970f0ef4754d6a..faf7d5b69d8fd4 100644 --- a/src/daemon/main.h +++ b/src/daemon/main.h @@ -7,21 +7,6 @@ extern struct config netdata_config; -/** - * This struct contains information about command line options. - */ -struct option_def { - /** The option character */ - const char val; - /** The name of the long option. */ - const char *description; - /** Short description what the option does */ - /** Name of the argument displayed in SYNOPSIS */ - const char *arg_name; - /** Default value if not set */ - const char *default_value; -}; - void cancel_main_threads(void); int killpid(pid_t pid);