Re: [PATCH] Show usage string for 'git http-push -h'
- From
Tay Ray Chuan <rctay89@gmail.com>
- Date
- Nov 9, 2009, 08:52 UTC
- Message-ID
- <be6fef0d0911090052s158ac720ha1fac70da748106d@mail.gmail.com>
- In-Reply-To
- <20091108072604.GA21367@progeny.tock>
Hi,
On Sun, Nov 8, 2009 at 3:26 PM, Jonathan Nieder <jrnieder@gmail.com> wrote:
Show 12 quoted lines
> @@ -1792,6 +1792,11 @@ int main(int argc, char **argv)
>
> git_extract_argv0_path(argv[0]);
>
> + if (argc == 2 && !strcmp(argv[1], "-h")) {
> + fprintf(stderr, "usage: %s\n", http_push_usage);
> + return 0;
> + }
> +
> setup_git_directory();
>
> repo = xcalloc(sizeof(*repo), 1);just curious, I'm wondering why isn't the check for "-h" done in the argv loop later on? I see this being done already in the builtins diff, log, ls-remote and update-index.
Also, unlike grep, -h <arg> is not an option we're looking out for, so I'm not sure if we should allow the user to mix -h with a valid set of arguments (which is what Johnathan's patch would allow).
-- Cheers, Ray Chuan