diff options
Diffstat (limited to 'help.c')
-rw-r--r-- | help.c | 24 |
1 files changed, 16 insertions, 8 deletions
@@ -1,9 +1,10 @@ -#include "cache.h" +#include "git-compat-util.h" #include "config.h" #include "builtin.h" #include "exec-cmd.h" #include "run-command.h" #include "levenshtein.h" +#include "gettext.h" #include "help.h" #include "command-list.h" #include "string-list.h" @@ -307,7 +308,8 @@ void load_command_list(const char *prefix, exclude_cmds(other_cmds, main_cmds); } -static int get_colopts(const char *var, const char *value, void *data) +static int get_colopts(const char *var, const char *value, + const struct config_context *ctx UNUSED, void *data) { unsigned int *colopts = data; @@ -457,12 +459,16 @@ void list_developer_interfaces_help(void) putchar('\n'); } -static int get_alias(const char *var, const char *value, void *data) +static int get_alias(const char *var, const char *value, + const struct config_context *ctx UNUSED, void *data) { struct string_list *list = data; - if (skip_prefix(var, "alias.", &var)) + if (skip_prefix(var, "alias.", &var)) { + if (!value) + return config_error_nonbool(var); string_list_append(list, var)->util = xstrdup(value); + } return 0; } @@ -540,7 +546,9 @@ static struct cmdnames aliases; #define AUTOCORRECT_NEVER (-2) #define AUTOCORRECT_IMMEDIATELY (-1) -static int git_unknown_cmd_config(const char *var, const char *value, void *cb) +static int git_unknown_cmd_config(const char *var, const char *value, + const struct config_context *ctx, + void *cb UNUSED) { const char *p; @@ -554,7 +562,7 @@ static int git_unknown_cmd_config(const char *var, const char *value, void *cb) } else if (!strcmp(value, "prompt")) { autocorrect = AUTOCORRECT_PROMPT; } else { - int v = git_config_int(var, value); + int v = git_config_int(var, value, ctx->kvi); autocorrect = (v < 0) ? AUTOCORRECT_IMMEDIATELY : v; } @@ -563,7 +571,7 @@ static int git_unknown_cmd_config(const char *var, const char *value, void *cb) if (skip_prefix(var, "alias.", &p)) add_cmdname(&aliases, p, strlen(p)); - return git_default_config(var, value, cb); + return 0; } static int levenshtein_compare(const void *p1, const void *p2) @@ -757,7 +765,7 @@ int cmd_version(int argc, const char **argv, const char *prefix) struct strbuf buf = STRBUF_INIT; int build_options = 0; const char * const usage[] = { - N_("git version [<options>]"), + N_("git version [--build-options]"), NULL }; struct option options[] = { |