summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPřemysl Janouch <p.janouch@gmail.com>2015-07-10 00:26:50 +0200
committerPřemysl Janouch <p.janouch@gmail.com>2015-07-10 00:55:13 +0200
commit4ddded35127135a369d1abcd7aa08ee0d94d4367 (patch)
tree3aa6cf66335f28c15ae04b0c55d5bf1258917f12
parent3e17bfb54c3d050ecd56ae2853e75002017c9958 (diff)
downloadxK-4ddded35127135a369d1abcd7aa08ee0d94d4367.tar.gz
xK-4ddded35127135a369d1abcd7aa08ee0d94d4367.tar.xz
xK-4ddded35127135a369d1abcd7aa08ee0d94d4367.zip
degesch: print the logo in a buffer
-rw-r--r--degesch.c39
1 files changed, 16 insertions, 23 deletions
diff --git a/degesch.c b/degesch.c
index 378b12f..ed49617 100644
--- a/degesch.c
+++ b/degesch.c
@@ -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);