mirror of
https://github.com/git/git.git
synced 2024-11-28 12:34:08 +08:00
1b1dd23f2d
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>
26 lines
457 B
C
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);
|
|
}
|