remove match_pathspec() in favor of match_pathspec_depth()
[gitweb.git] / builtin / help.c
index 03d432b19e9740e4e383d8f58136e3428b23d5ec..f1e236b9124f8b7bfd9aa5e926d525c6f4568268 100644 (file)
@@ -1,6 +1,4 @@
 /*
- * builtin-help.c
- *
  * Builtin help command
  */
 #include "cache.h"
@@ -415,6 +413,37 @@ static void show_html_page(const char *git_cmd)
        open_html(page_path.buf);
 }
 
+static struct {
+       const char *name;
+       const char *help;
+} common_guides[] = {
+       { "attributes", N_("Defining attributes per path") },
+       { "glossary", N_("A Git glossary") },
+       { "ignore", N_("Specifies intentionally untracked files to ignore") },
+       { "modules", N_("Defining submodule properties") },
+       { "revisions", N_("Specifying revisions and ranges for Git") },
+       { "tutorial", N_("A tutorial introduction to Git (for version 1.5.1 or newer)") },
+       { "workflows", N_("An overview of recommended workflows with Git") },
+};
+
+static void list_common_guides_help(void)
+{
+       int i, longest = 0;
+
+       for (i = 0; i < ARRAY_SIZE(common_guides); i++) {
+               if (longest < strlen(common_guides[i].name))
+                       longest = strlen(common_guides[i].name);
+       }
+
+       puts(_("The common Git guides are:\n"));
+       for (i = 0; i < ARRAY_SIZE(common_guides); i++) {
+               printf("   %s   ", common_guides[i].name);
+               mput_char(' ', longest - strlen(common_guides[i].name));
+               puts(_(common_guides[i].help));
+       }
+       putchar('\n');
+}
+
 int cmd_help(int argc, const char **argv, const char *prefix)
 {
        int nongit;
@@ -432,9 +461,8 @@ int cmd_help(int argc, const char **argv, const char *prefix)
                list_commands(colopts, &main_cmds, &other_cmds);
        }
 
-       if (show_guides) {
-               /* do action - next patch */
-       }
+       if (show_guides)
+               list_common_guides_help();
 
        if (show_all || show_guides) {
                printf("%s\n", _(git_more_info_string));