git-commit-vandalism/update-server-info.c
Stephan Beyer 1b1dd23f2d Make usage strings dash-less
When you misuse a git command, you are shown the usage string.
But this is currently shown in the dashed form.  So if you just
copy what you see, it will not work, when the dashed form
is no longer supported.

This patch makes git commands show the dash-less version.

For shell scripts that do not specify OPTIONS_SPEC, git-sh-setup.sh
generates a dash-less usage string now.

Signed-off-by: Stephan Beyer <s-beyer@gmx.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-07-13 14:12:48 -07:00

26 lines
457 B
C

#include "cache.h"
static const char update_server_info_usage[] =
"git update-server-info [--force]";
int main(int ac, char **av)
{
int i;
int force = 0;
for (i = 1; i < ac; i++) {
if (av[i][0] == '-') {
if (!strcmp("--force", av[i]) ||
!strcmp("-f", av[i]))
force = 1;
else
usage(update_server_info_usage);
}
}
if (i != ac)
usage(update_server_info_usage);
setup_git_directory();
return !!update_server_info(force);
}