usage: add error message informing mustach support is not available

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
This commit is contained in:
Sami Kerola 2017-11-11 21:15:36 +00:00
parent 39b2811aa7
commit 7575294c36
No known key found for this signature in database
GPG key ID: A9553245FDE9B739

View file

@ -127,9 +127,7 @@ int main(int argc, char **argv)
{"reverse", no_argument, NULL, 'r'}, {"reverse", no_argument, NULL, 'r'},
{"output", required_argument, NULL, 'o'}, {"output", required_argument, NULL, 'o'},
{"limit", required_argument, NULL, 'L'}, {"limit", required_argument, NULL, 'L'},
#ifdef BUILD_MUSTACH
{"mustach", required_argument, NULL, OPT_MUSTACH}, {"mustach", required_argument, NULL, OPT_MUSTACH},
#endif
{"version", no_argument, NULL, 'v'}, {"version", no_argument, NULL, 'v'},
{"help", no_argument, NULL, 'h'}, {"help", no_argument, NULL, 'h'},
{"snet-alarms", no_argument, NULL, OPT_SNET_ALARMS}, {"snet-alarms", no_argument, NULL, OPT_SNET_ALARMS},
@ -229,12 +227,14 @@ int main(int argc, char **argv)
config.header_limit = return_limit(optarg[0]); config.header_limit = return_limit(optarg[0]);
config.number_limit = return_limit(optarg[1]); config.number_limit = return_limit(optarg[1]);
break; break;
#ifdef BUILD_MUSTACH
case OPT_MUSTACH: case OPT_MUSTACH:
#ifdef BUILD_MUSTACH
config.mustach_template = optarg; config.mustach_template = optarg;
output_format = 'm'; output_format = 'm';
break; #else
error(EXIT_FAILURE, 0, "compiled without mustach support");
#endif #endif
break;
case OPT_COLOR: case OPT_COLOR:
config.color_mode = parse_color_mode(optarg); config.color_mode = parse_color_mode(optarg);
if (config.color_mode == color_unknown) if (config.color_mode == color_unknown)