degesch: add a first time help
This commit is contained in:
		
							
								
								
									
										33
									
								
								degesch.c
									
									
									
									
									
								
							
							
						
						
									
										33
									
								
								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);
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user