i18n: mark all progress lines for translation
[gitweb.git] / builtin / help.c
index 034c36c254c3d4321ce6ef97adfe59dcae73bb2e..1fdefeb6867cdd37beaf41c5fa9e113576b19f17 100644 (file)
@@ -1,6 +1,4 @@
 /*
- * builtin-help.c
- *
  * Builtin help command
  */
 #include "cache.h"
@@ -102,7 +100,7 @@ static int check_emacsclient_version(void)
         */
        finish_command(&ec_process);
 
-       if (prefixcmp(buffer.buf, "emacsclient")) {
+       if (!starts_with(buffer.buf, "emacsclient")) {
                strbuf_release(&buffer);
                return error(_("Failed to parse emacsclient version."));
        }
@@ -260,7 +258,7 @@ static int add_man_viewer_info(const char *var, const char *value)
 
 static int git_help_config(const char *var, const char *value, void *cb)
 {
-       if (!prefixcmp(var, "column."))
+       if (starts_with(var, "column."))
                return git_column_config(var, value, "help", &colopts);
        if (!strcmp(var, "help.format")) {
                if (!value)
@@ -280,7 +278,7 @@ static int git_help_config(const char *var, const char *value, void *cb)
                add_man_viewer(value);
                return 0;
        }
-       if (!prefixcmp(var, "man."))
+       if (starts_with(var, "man."))
                return add_man_viewer_info(var, value);
 
        return git_default_config(var, value, cb);
@@ -290,6 +288,10 @@ static struct cmdnames main_cmds, other_cmds;
 
 static int is_git_command(const char *s)
 {
+       if (is_builtin(s))
+               return 1;
+
+       load_command_list("git-", &main_cmds, &other_cmds);
        return is_in_cmdlist(&main_cmds, s) ||
                is_in_cmdlist(&other_cmds, s);
 }
@@ -308,7 +310,7 @@ static const char *cmd_to_page(const char *git_cmd)
 {
        if (!git_cmd)
                return "git";
-       else if (!prefixcmp(git_cmd, "git"))
+       else if (starts_with(git_cmd, "git"))
                return git_cmd;
        else if (is_git_command(git_cmd))
                return prepend("git-", git_cmd);
@@ -419,13 +421,13 @@ static struct {
        const char *name;
        const char *help;
 } common_guides[] = {
-       { "attributes", "Defining attributes per path" },
-       { "glossary", "A Git glossary" },
-       { "ignore", "Specifies intentionally untracked files to ignore" },
-       { "modules", "Defining submodule properties" },
-       { "revisions", "Specifying revisions and ranges for Git" },
-       { "tutorial", "A tutorial introduction to Git (for version 1.5.1 or newer)" },
-       { "workflows", "An overview of recommended workflows with Git"},
+       { "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)
@@ -451,7 +453,6 @@ int cmd_help(int argc, const char **argv, const char *prefix)
        int nongit;
        const char *alias;
        enum help_format parsed_help_format;
-       load_command_list("git-", &main_cmds, &other_cmds);
 
        argc = parse_options(argc, argv, prefix, builtin_help_options,
                        builtin_help_usage, 0);
@@ -460,6 +461,7 @@ int cmd_help(int argc, const char **argv, const char *prefix)
        if (show_all) {
                git_config(git_help_config, NULL);
                printf(_("usage: %s%s"), _(git_usage_string), "\n\n");
+               load_command_list("git-", &main_cmds, &other_cmds);
                list_commands(colopts, &main_cmds, &other_cmds);
        }