mirror of
https://github.com/git/git
synced 2024-11-05 18:59:29 +00:00
8c9e292dc0
Fix various issues of SYNOPSIS and -h output syntax where: * Options such as --force were missing entirely * ...or the short option, such as -f * We said "opts" or "options", but could instead enumerate the (small) set of supported options * Options that were missing entirely (ls-remote's --sort=<key>) As we can specify "--sort" multiple times (it's backed by a string-list" it should really be "[(--sort=<key>)...]", which is what "git for-each-ref" lists it as, but let's leave that issue for a subsequent cleanup, and stop at making these consistent. Other "ref-filter.h" users share the same issue, e.g. "git-branch.txt". * For "verify-tag" and "verify-commit" we were missing the "--raw" option. Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
26 lines
644 B
C
26 lines
644 B
C
#include "cache.h"
|
|
#include "config.h"
|
|
#include "builtin.h"
|
|
#include "parse-options.h"
|
|
|
|
static const char * const update_server_info_usage[] = {
|
|
"git update-server-info [-f | --force]",
|
|
NULL
|
|
};
|
|
|
|
int cmd_update_server_info(int argc, const char **argv, const char *prefix)
|
|
{
|
|
int force = 0;
|
|
struct option options[] = {
|
|
OPT__FORCE(&force, N_("update the info files from scratch"), 0),
|
|
OPT_END()
|
|
};
|
|
|
|
git_config(git_default_config, NULL);
|
|
argc = parse_options(argc, argv, prefix, options,
|
|
update_server_info_usage, 0);
|
|
if (argc > 0)
|
|
usage_with_options(update_server_info_usage, options);
|
|
|
|
return !!update_server_info(force);
|
|
}
|