diff options
author | Junio C Hamano <gitster@pobox.com> | 2010-05-21 15:02:14 +0400 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2010-05-21 15:02:14 +0400 |
commit | 7f3ed824a4ec15fc9725a4992b399ea4364c5adb (patch) | |
tree | 7604efbf6f1b7511449f87a937658d6efa53ddcc /git.c | |
parent | e2ab0227aab5cdcede3b39e4c95b118f09a71d29 (diff) | |
parent | b3d83d9f2ef1b0f0f53bb7254e234c743aa42817 (diff) |
Merge branch 'ar/config-from-command-line'
* ar/config-from-command-line:
Complete prototype of git_config_from_parameters()
Use strbufs instead of open-coded string manipulation
Allow passing of configuration parameters in the command line
Diffstat (limited to 'git.c')
-rw-r--r-- | git.c | 9 |
1 files changed, 9 insertions, 0 deletions
@@ -8,6 +8,7 @@ const char git_usage_string[] = "git [--version] [--exec-path[=GIT_EXEC_PATH]] [--html-path]\n" " [-p|--paginate|--no-pager] [--no-replace-objects]\n" " [--bare] [--git-dir=GIT_DIR] [--work-tree=GIT_WORK_TREE]\n" + " [-c name=value\n" " [--help] COMMAND [ARGS]"; const char git_more_info_string[] = @@ -130,6 +131,14 @@ static int handle_options(const char ***argv, int *argc, int *envchanged) setenv(GIT_DIR_ENVIRONMENT, getcwd(git_dir, sizeof(git_dir)), 0); if (envchanged) *envchanged = 1; + } else if (!strcmp(cmd, "-c")) { + if (*argc < 2) { + fprintf(stderr, "-c expects a configuration string\n" ); + usage(git_usage_string); + } + git_config_parse_parameter((*argv)[1]); + (*argv)++; + (*argc)--; } else { fprintf(stderr, "Unknown option: %s\n", cmd); usage(git_usage_string); |