aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPřemysl Janouch <p.janouch@gmail.com>2015-07-09 23:55:41 +0200
committerPřemysl Janouch <p.janouch@gmail.com>2015-07-10 00:55:13 +0200
commit3e17bfb54c3d050ecd56ae2853e75002017c9958 (patch)
tree6cdd9ec831ab0439858ce3005dd770ee7bf6841d
parent7a7192d327ea92285653f4de7b0b21046437498d (diff)
downloadxK-3e17bfb54c3d050ecd56ae2853e75002017c9958.tar.gz
xK-3e17bfb54c3d050ecd56ae2853e75002017c9958.tar.xz
xK-3e17bfb54c3d050ecd56ae2853e75002017c9958.zip
degesch: add a first time help
-rw-r--r--degesch.c33
1 files changed, 33 insertions, 0 deletions
diff --git a/degesch.c b/degesch.c
index f4fc87c..378b12f 100644
--- a/degesch.c
+++ b/degesch.c
@@ -8570,6 +8570,34 @@ end:
return root;
}
+static const char *g_first_time_help[] =
+{
+ "",
+ "\x02Welcome to degesch!",
+ "",
+ "To get a list of all commands, type \x02/help\x0f. To obtain",
+ "more information on a command or option, simply add it as",
+ "a parameter, e.g. \x02/help set\x0f or \x02/help behaviour.logging\x0f.",
+ "",
+ "To switch between buffers, press \x02"
+ "F5/Ctrl-P\x0f or \x02" "F6/Ctrl-N\x0f.",
+ "",
+ "Finally, adding a network is as simple as:",
+ " - \x02/server add freenode\x0f",
+ " - \x02/set servers.freenode.addresses = \"chat.freenode.net\"\x0f",
+ " - \x02/connect freenode\x0f",
+ "",
+ "That should be enough to get you started. Have fun!",
+ ""
+};
+
+static void
+show_first_time_help (struct app_context *ctx)
+{
+ for (size_t i = 0; i < N_ELEMENTS (g_first_time_help); i++)
+ log_global_indent (ctx, "#m", g_first_time_help[i]);
+}
+
static void
load_configuration (struct app_context *ctx)
{
@@ -8588,6 +8616,7 @@ load_configuration (struct app_context *ctx)
log_global_error (ctx, "#s", e->message);
error_free (e);
}
+
if (root)
{
config_item_destroy (ctx->config.root);
@@ -8595,6 +8624,10 @@ load_configuration (struct app_context *ctx)
config_load (&ctx->config, root);
log_global_status (ctx, "Configuration loaded");
}
+ else
+ {
+ show_first_time_help (ctx);
+ }
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -