Skip to content

Commit

Permalink
Do not declare struct meant for internal usage (netdata#16951)
Browse files Browse the repository at this point in the history
  • Loading branch information
vkalintiris authored Feb 6, 2024
1 parent 1aa658f commit c7f60b1
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 30 deletions.
34 changes: 19 additions & 15 deletions src/daemon/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
15 changes: 0 additions & 15 deletions src/daemon/main.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down

0 comments on commit c7f60b1

Please sign in to comment.