Permalink
Browse files

*** empty log message ***

  • Loading branch information...
1 parent c8abd2c commit 3268e75380bd51016371b1cb6928a47cd6c7bbf0 massie committed Jan 20, 2005
@@ -47,6 +47,8 @@ cmdline_parser_print_help (void)
printf(" -d, --debug=INT Debug level. If greater than zero, daemon will stay \n in foreground. (default=`0')\n");
printf(" -f, --foreground Run in foreground (don't daemonize) (default=off)\n");
printf(" -t, --default_config Print the default configuration to stdout and exit \n (default=off)\n");
+ printf(" -m, --metrics Print the list of metrics this gmond supports \n (default=off)\n");
+ printf(" -b, --bandwidth Calculate minimum bandwidth use for configuration \n (default=off)\n");
}
@@ -77,12 +79,16 @@ cmdline_parser (int argc, char * const *argv, struct gengetopt_args_info *args_i
args_info->debug_given = 0 ;
args_info->foreground_given = 0 ;
args_info->default_config_given = 0 ;
+ args_info->metrics_given = 0 ;
+ args_info->bandwidth_given = 0 ;
#define clear_args() { \
args_info->conf_arg = gengetopt_strdup("/etc/gmond.conf") ;\
args_info->location_arg = gengetopt_strdup("0,0,0") ;\
args_info->debug_arg = 0 ;\
args_info->foreground_flag = 0;\
args_info->default_config_flag = 0;\
+ args_info->metrics_flag = 0;\
+ args_info->bandwidth_flag = 0;\
}
clear_args();
@@ -105,11 +111,13 @@ cmdline_parser (int argc, char * const *argv, struct gengetopt_args_info *args_i
{ "debug", 1, NULL, 'd' },
{ "foreground", 0, NULL, 'f' },
{ "default_config", 0, NULL, 't' },
+ { "metrics", 0, NULL, 'm' },
+ { "bandwidth", 0, NULL, 'b' },
{ NULL, 0, NULL, 0 }
};
stop_char = 0;
- c = getopt_long (argc, argv, "hVc:l:d:ft", long_options, &option_index);
+ c = getopt_long (argc, argv, "hVc:l:d:ftmb", long_options, &option_index);
if (c == -1) break; /* Exit from `while (1)' loop. */
@@ -184,6 +192,28 @@ cmdline_parser (int argc, char * const *argv, struct gengetopt_args_info *args_i
args_info->default_config_flag = !(args_info->default_config_flag);
break;
+ case 'm': /* Print the list of metrics this gmond supports. */
+ if (args_info->metrics_given)
+ {
+ fprintf (stderr, "%s: `--metrics' (`-m') option given more than once\n", CMDLINE_PARSER_PACKAGE);
+ clear_args ();
+ exit (EXIT_FAILURE);
+ }
+ args_info->metrics_given = 1;
+ args_info->metrics_flag = !(args_info->metrics_flag);
+ break;
+
+ case 'b': /* Calculate minimum bandwidth use for configuration. */
+ if (args_info->bandwidth_given)
+ {
+ fprintf (stderr, "%s: `--bandwidth' (`-b') option given more than once\n", CMDLINE_PARSER_PACKAGE);
+ clear_args ();
+ exit (EXIT_FAILURE);
+ }
+ args_info->bandwidth_given = 1;
+ args_info->bandwidth_flag = !(args_info->bandwidth_flag);
+ break;
+
case 0: /* Long option with no short option */
@@ -29,6 +29,8 @@ struct gengetopt_args_info
int debug_arg; /* Debug level. If greater than zero, daemon will stay in foreground. (default='0'). */
int foreground_flag; /* Run in foreground (don't daemonize) (default=off). */
int default_config_flag; /* Print the default configuration to stdout and exit (default=off). */
+ int metrics_flag; /* Print the list of metrics this gmond supports (default=off). */
+ int bandwidth_flag; /* Calculate minimum bandwidth use for configuration (default=off). */
int help_given ; /* Whether help was given. */
int version_given ; /* Whether version was given. */
@@ -37,6 +39,8 @@ struct gengetopt_args_info
int debug_given ; /* Whether debug was given. */
int foreground_given ; /* Whether foreground was given. */
int default_config_given ; /* Whether default_config was given. */
+ int metrics_given ; /* Whether metrics was given. */
+ int bandwidth_given ; /* Whether bandwidth was given. */
} ;
@@ -11,6 +11,8 @@ option "location" l "Location of this host in the cluster 'rack,rank,plane'." st
option "debug" d "Debug level. If greater than zero, daemon will stay in foreground." int default="0" no
option "foreground" f "Run in foreground (don't daemonize)" flag off
option "default_config" t "Print the default configuration to stdout and exit" flag off
+option "metrics" m "Print the list of metrics this gmond supports" flag off
+option "bandwidth" b "Calculate minimum bandwidth use for configuration" flag off
#Usage (a little tutorial)
#
Oops, something went wrong.

0 comments on commit 3268e75

Please sign in to comment.