From 2cbafc754d5e14811c808f65ce9e60b4d4bf7df5 Mon Sep 17 00:00:00 2001 From: Bryce Kwon Date: Sun, 19 Jul 2026 15:54:22 -1000 Subject: Add a help page with common workflows --- source/cmd.c | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'source/cmd.c') diff --git a/source/cmd.c b/source/cmd.c index 477bb3f..a8768eb 100644 --- a/source/cmd.c +++ b/source/cmd.c @@ -23,6 +23,7 @@ #include "ui-repolist.h" #include "ui-snapshot.h" #include "ui-stats.h" +#include "ui-help.h" #include "ui-summary.h" #include "ui-tag.h" #include "ui-tree.h" @@ -32,6 +33,14 @@ static void HEAD_fn(void) cgit_clone_head(); } +static void help_fn(void) +{ + if (ctx.cfg.enable_help) + cgit_print_help(); + else + cgit_print_error_page(404, "Not found", "Help is disabled"); +} + static void atom_fn(void) { cgit_print_atom(ctx.qry.head, ctx.qry.path, ctx.cfg.max_atom_items); @@ -184,6 +193,7 @@ struct cgit_cmd *cgit_get_cmd(void) def_cmd(blob, 1, 0, 0), def_cmd(commit, 1, 1, 0), def_cmd(diff, 1, 1, 0), + def_cmd(help, 0, 0, 0), def_cmd(info, 1, 0, 1), def_cmd(log, 1, 1, 0), def_cmd(ls_cache, 0, 0, 0), -- cgit v2.8.0