diff options
| author | Bryce Kwon <bryce@brycekwon.com> | |
|---|---|---|
| committer | Bryce Kwon <bryce@brycekwon.com> | |
| commit | ||
| parent | ||
| tree | ||
| download | ||
Add a help page with common workflows
Diffstat (limited to '')
| -rw-r--r-- | source/cmd.c | 10 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
1 file changed, 10 insertions, 0 deletions
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), |
