diff options
-rw-r--r-- | degesch.c | 39 |
1 files changed, 16 insertions, 23 deletions
@@ -8841,28 +8841,22 @@ init_poller_events (struct app_context *ctx) // --- Main program ------------------------------------------------------------ +static const char *g_logo[] = +{ + " __ __ ", + " __/ / ____ ____ ____ ____ ____ / /_ ", + " / / / , / / / / , / / __/ / __/ / __ \\ ", + " / / / / __/ / / / / __/ /_ / / /_ / / / / ", + "/___/ /___/ /_ / /___/ /___/ /___/ /_/ /_/ " PROGRAM_VERSION, + " /___/ ", + "" +}; + static void -display_logo (void) +show_logo (struct app_context *ctx) { - const char *logo = - " __ __ \n" - " __/ / ____ ____ ____ ____ ____ / /_ \n" - " / / / , / / / / , / / __/ / __/ / __ \\ \n" - " / / / / __/ / / / / __/ /_ / / /_ / / / / \n" - " /___/ /___/ /_ / /___/ /___/ /___/ /_/ /_/ \n" - " /___/ \n" - " "; - - struct str_vector v; - str_vector_init (&v); - char *x = xstrdup_printf ("%s%s", - logo, PROGRAM_NAME " " PROGRAM_VERSION " starting"); - split_str (x, '\n', &v); - free (x); - - for (size_t i = 0; i < v.len; i++) - print_status ("%s", v.vector[i]); - str_vector_free (&v); + for (size_t i = 0; i < N_ELEMENTS (g_logo); i++) + log_global_indent (ctx, "#m", g_logo[i]); } int @@ -8901,9 +8895,7 @@ main (int argc, char *argv[]) opt_handler_usage (&oh, stderr); exit (EXIT_FAILURE); } - opt_handler_free (&oh); - display_logo (); // We only need to convert to and from the terminal encoding setlocale (LC_CTYPE, ""); @@ -8922,9 +8914,10 @@ main (int argc, char *argv[]) config_load (&ctx.config, config_item_object ()); // The following part is a bit brittle because of interdependencies - setup_signal_handlers (); init_colors (&ctx); init_global_buffer (&ctx); + show_logo (&ctx); + setup_signal_handlers (); init_poller_events (&ctx); load_configuration (&ctx); |