From b3a2f2bfcf483b525c55de211e3c644dba860e51 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Thu, 5 Aug 2021 14:03:48 -0600 Subject: [PATCH] [util/main-font-text] Simplify --- util/main-font-text.hh | 21 ++++++++------------- 1 file changed, 8 insertions(+), 13 deletions(-) diff --git a/util/main-font-text.hh b/util/main-font-text.hh index b75fc551b..2bca9251c 100644 --- a/util/main-font-text.hh +++ b/util/main-font-text.hh @@ -50,18 +50,18 @@ locale_to_utf8 (char *s) template struct main_font_text_t { - void add_options (option_parser_t *parser) - { - font_opts.add_options (parser); - input.add_options (parser); - consumer.add_options (parser); - } - int main (int argc, char **argv, int eol = '\n') { + + font_options_t font_opts; + text_options_t input; + consumer_t consumer; + option_parser_t options ("[FONT-FILE] [TEXT]"); - add_options (&options); + font_opts.add_options (&options); + input.add_options (&options); + consumer.add_options (&options); options.parse (&argc, &argv); argc--, argv++; @@ -85,11 +85,6 @@ struct main_font_text_t return consumer.failed ? 1 : 0; } - - protected: - font_options_t font_opts; - text_options_t input; - consumer_t consumer; }; #endif