degesch: print the logo in a buffer

This commit is contained in:
Přemysl Eric Janouch 2015-07-10 00:26:50 +02:00
parent 3e17bfb54c
commit 4ddded3512
1 changed files with 16 additions and 23 deletions

View File

@ -8841,28 +8841,22 @@ init_poller_events (struct app_context *ctx)
// --- Main program ------------------------------------------------------------
static void
display_logo (void)
static const char *g_logo[] =
{
const char *logo =
" __ __ \n"
" __/ / ____ ____ ____ ____ ____ / /_ \n"
" / / / , / / / / , / / __/ / __/ / __ \\ \n"
" / / / / __/ / / / / __/ /_ / / /_ / / / / \n"
" /___/ /___/ /_ / /___/ /___/ /___/ /_/ /_/ \n"
" /___/ \n"
" ";
" __ __ ",
" __/ / ____ ____ ____ ____ ____ / /_ ",
" / / / , / / / / , / / __/ / __/ / __ \\ ",
" / / / / __/ / / / / __/ /_ / / /_ / / / / ",
"/___/ /___/ /_ / /___/ /___/ /___/ /_/ /_/ " PROGRAM_VERSION,
" /___/ ",
""
};
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);
static void
show_logo (struct app_context *ctx)
{
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);